I have a multidimensional array in this form:
array = [[3, 5],
[2, 5],
[9, 7],
[3, 5]]
I need it to return:
array = [[3, 5],
[2, 5],
[9, 7]]
I have tried set(array) but that does not work. Help.
I have a multidimensional array in this form:
array = [[3, 5],
[2, 5],
[9, 7],
[3, 5]]
I need it to return:
array = [[3, 5],
[2, 5],
[9, 7]]
I have tried set(array) but that does not work. Help.
This code works.
import numpy as np
a = np.array([[3, 5],
[2, 5],
[9, 7],
[3, 5]])
print(a)
#remove the duplicate sub-arrays
b = np.unique(a,axis=0)
print(b)