You can remove duplicates from the NumPy array with the following code. If you want to learn Python, I highly recommend reading This Book.
Remove duplicates from the NumPy array
# Import the NumPy Library import numpy as np # Initialize the Array a = np.array([1, 1, 2, 3, 4, 10, 1]) # Display print(np.unique(a))
Output:
[ 1 2 3 4 10]