Im learning Python for a CS class and we just started using numpy and scipy for more mathematic functions. One of the exercises was to delete every second element from a vector of size 100, which in itself was not a big problem.
import numpy as np
v = np.arange(100).reshape(100,1)
for x in range(99, 0, -2):
v = np.delete(v, x)
However, after deleting an element, the vector seems to lose its shape and Im unable to figure out how to reshape it or delete the elements without it losing its shape in the first place. We are not supposed to create a new vector to ´copy the elements into.
Any help is appreciated