make unique rows for multi dimensional array
Use numpy unique
import numpy as np
data = np.array([[1,8,3,3,4],
[1,8,9,9,4],
[1,8,3,3,4]])
>>> np.unique(data) # flat the array and generate uniqueness of the elements
array([1, 3, 4, 8, 9])
new_array = [tuple(row) for row in data]
uniques = np.unique(new_array, axis=0) # important the axis parameter
>>> uniques
array([[1, 8, 3, 3, 4],
[1, 8, 9, 9, 4]])
use python set function
data = [(1,8,3,3,4),
(1,8,9,9,4),
(1,8,3,3,4)]
uniques = list(set(data))
>>> uniques
array([[1, 8, 3, 3, 4],
[1, 8, 9, 9, 4]])