I need to find unique rows in a numpy.array.
numpy.array
For example:
>>> a # I have array([[1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 0, 0],
Why not use drop_duplicates from pandas:
drop_duplicates
>>> timeit pd.DataFrame(image.reshape(-1,3)).drop_duplicates().values 1 loops, best of 3: 3.08 s per loop >>> timeit np.vstack({tuple(r) for r in image.reshape(-1,3)}) 1 loops, best of 3: 51 s per loop