I have an ND array, and I want to delete a specific row by value, How to do so? Currently, the output is an empty list.
import numpy as np
def delete_item(array, item):
new_a = np.delete(array, np.where(array == item), axis=0)
return new_a
a = np.array([[1, 1, 1], [85, 32, 531], [78, 91, 79]])
new_array = delete_item(a, [1, 1, 1]) # -> it returns empty list []
"""
The output is:
[]
What i want is:
[[85, 32, 531],
[78, 91, 79]]
"""
print(new_array)