0
votes

I have an array like:

a =np.array([[1,2,3,5,8,7,2,1,3,5,1,2,20,21],[3,8,3,9,8,7,10,1,3,5,1,2,20,21]])

requirement:

need to access index value with given step. For an example step value 3. Only index value not an elements value.

Required Output:

[[0,3,6,9,12],[0,3,6,9,12]]
What have you tried so far? - Dani Mesejo
I tried with 1D array with range function. Its okay with 1D - Bhar Jay
Repeat it in a list comprehension. - Barmar