How to change element in np.array by index
Simply, you can use: a[::2]=10
How to change an element in np array by index without any loops and if statements.
E.g we have array [1,2,3,4], and every second element, starting from 0, I want to change to 10. So as to get [10,2,10,4].