How do I remove duplicates when a numpy array field has duplicates.
for example, i have an array like this:
vals = numpy.array([[1,2,3],[1,5,6],[1,8,7],[0,4,5],[2,2,1],[0,0,0],[5,4,3]])
array([[1, 2, 3],
[1, 5, 6],
[1, 8, 7],
[0, 4, 5],
[2, 2, 1],
[0, 0, 0],
[5, 4, 3]])
i need to remove the duplicates for field [0], so that i got the results like:
([1,2,3],
[0, 4, 5],
[2, 2, 1],
[0, 0, 0],
[5, 4, 3]])
[0, 0, 0]be removed too?