Say I do the following:
my_array = np.array([[1,2,3]])
my_new_array = np.delete(my_array, [])
The last line will convert my_array
to:
my_new_array = np.array([1,2,3]) # It flattens the array one level
which is not what I expected.
If instead I had had:
my_array = np.array([[1,2,3], [4,5,6]])
my_new_array = np.delete(my_array, [])
I would get:
my_new_array = np.array([[1,2,3], [4,5,6]])
which is what I expect. How can I make sure a call to np.delete(my_array, [])
does not flattens my array?