I have a numpy array of dimension (48, 366, 3) and I want to remove the last column from the array to make it (48, 365, 3). What is the best way to do that? (All the entries are integers. I'm using Python v2.6)
You could try
or just get the slice of the array you want and write it to a new array.
a = np.random.randint(0,2, size=(48,366,3)) b = np.delete(a, np.s_[-1:], axis=1) print b.shape # <--- (48,365,3)
b = np.delete(a, -1, axis=1)
b = a[:,:-1,:]