Loading...
Extract portions of a NumPy array using slicing syntax.
NumPy slicing: arr[start:stop:step]
Write a function slice_array(arr) that returns a dictionary with:
Return a dictionary with exactly these four keys.
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
{'first_three': [0, 1, 2], 'last_three': [7, 8, 9], 'every_other': [0, 2, 4, 6, 8], 'reversed': [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]}[:3] for first 3, [-3:] for last 3, [::2] for every other, [::-1] for reverse