Lets say your numpy array is:
A = [1,1,2,3,4]
You can simply do:
A + .1
to add a number to that every element numpy array
I am looking for a way to add a number to just the odd or even indexed numbers A[::2] +1
while keeping the entire array intact.
Is it possible to add a number to all the odd or even indexed elements without any loops?