[SciPy-user] Ordering and Counting the Repetitions of the Rows of a Matrix
Sun Jul 27 11:17:47 CDT 2008
Consider an Nx2 matrix of the kind:
A= 1 2
The first entry in each row is always smaller or equal than the second
entry in the same row.
Now there are two things I would like to do with this A matrix:
(1) With a sort of n.unique1d (but have not been very successful yet),
let each row of A appear only once (i.e. get rid of the repetitions).
Therefore one should obtain the matrix:
B= 1 2
(2) At the same time, efficiently count how many times each row of B
appeared in A. I would like to get a C vector counting them as:
Any suggestions about an efficient way of achieving this?
More information about the SciPy-user