Having a numpy array for example a=np.array([[1,1,2],[7,8,5],[1,1,3],[1,1,2]])
I am intersted to retrieve in a fast way the number of occurences of each row. [1,1,2] =>2 etc.
I have done some implementation using lists, but on real data sets the computation time is very long.
Is there a method to do it faster , potentially using only numpy as data structure?
Asked
Active
Viewed 28 times
1

Alexandru Daia
- 21
- 2
-
1Also relevant : http://stackoverflow.com/questions/27000092/count-how-many-times-each-row-is-present-in-numpy-array – Divakar Oct 05 '16 at 06:22