[Numpy-discussion] Axis argument to np.unique

Martino Sorbaro martino.sorbaro at ed.ac.uk
Wed Jun 15 09:16:36 EDT 2016


Hi all,
I've opened a new pull request
(https://github.com/numpy/numpy/pull/7742) trying to revive a previous
one that was left abandoned (#3584, by another contributor), regarding
the possibility of adding an 'axis=' argument to numpy.unique.

There had been a debate
(http://numpy-discussion.10968.n7.nabble.com/Adding-an-axis-argument-to-numpy-unique-td34841.html)
about what the axis argument should mean. The current behaviour in the
code I propose (written by the previous contributor) looks for unique
rows if "axis=0" and unique columns if "axis=1", in other words:

[In]  a = array([[0, 0, 0],
                 [1, 1, 1],
                 [0, 0, 0]])

[In]  unique(a, axis=0)
[Out] array([[0, 0, 0],
             [1, 1, 1]])


So, I would just like to ask whether a conclusion can be reached about
that discussion.
Thanks!
Martino

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




More information about the NumPy-Discussion mailing list