That seems like the only reasonable behavior, but I will admit that my
initial desire is essentially a vectorized "unique" such that it returns
the unique values of the stated axis. But that isn't possible because there
can be different number of unique values in the given axis, resulting in a
ragged array, which numpy does not support.

Ben Root

On Wed, Jun 15, 2016 at 9:16 AM, Martino Sorbaro <martino.sorb...@ed.ac.uk>
wrote:

> 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.
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to