[Numpy-discussion] Adding an axis argument to numpy.unique
Mon Aug 19 19:39:03 CDT 2013
> However, my first interpretation of an axis argument in unique would
> be that it treats each column (or whatever along axis) separately.
> Analogously to max, argmax and similar.
That's certainly a potential source of confusion. However, I can't seem to
come up with a better name for the kwarg. Matlab's "unique" function has a
"rows" option, which is probably a more intuitive name, but doesn't imply
the expansion to N-dimensions.
"axis" is still fairly idiomatic, despite the confusion over "unique
rows/columns/etc" vs "unique items within each row/column/etc".
Any thoughts on a better name for the argument?
> On second thought:
> unique with axis working on each column separately wouldn't create a
> nice return array, because it won't be rectangular (in general)
Yeah, and "unique items within each row/column/etc" would be best
implemented as a one-line list comprehension for that reason, rather than
an addition to unique, i.m.o.
Thanks for the feedback!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion