Re: [Numpy-discussion] Adding an axis argument to numpy.unique

2013-08-20 Thread Joe Kington
> > To me, `unique_rows` sounds perfect. To go along columns: unique_rows(A.T) > Stéfan Personally, I like this idea as well. A separate `unique_rows` function, which potentially takes an `axis` argument. (Alternately, `unique_sequences` wouldn't imply a particular axis.) Of course, the obvi

Re: [Numpy-discussion] Adding an axis argument to numpy.unique

2013-08-20 Thread Nathaniel Smith
On 20 Aug 2013 12:53, wrote: > > On Tue, Aug 20, 2013 at 7:47 AM, wrote: > > On Tue, Aug 20, 2013 at 7:34 AM, Nathaniel Smith wrote: > >> On 20 Aug 2013 12:09, wrote: > >>> > >>> On Tue, Aug 20, 2013 at 5:04 AM, Nathaniel Smith wrote: > >>> > On 20 Aug 2013 01:39, "Joe Kington" wrote: > >>>

Re: [Numpy-discussion] Adding an axis argument to numpy.unique

2013-08-20 Thread josef . pktd
On Tue, Aug 20, 2013 at 7:47 AM, wrote: > On Tue, Aug 20, 2013 at 7:34 AM, Nathaniel Smith wrote: >> On 20 Aug 2013 12:09, wrote: >>> >>> On Tue, Aug 20, 2013 at 5:04 AM, Nathaniel Smith wrote: >>> > On 20 Aug 2013 01:39, "Joe Kington" wrote: >>> >> >>> >> >>> >> >>> >> >>> >> ... >>> >>> >>>

Re: [Numpy-discussion] Adding an axis argument to numpy.unique

2013-08-20 Thread josef . pktd
On Tue, Aug 20, 2013 at 7:34 AM, Nathaniel Smith wrote: > On 20 Aug 2013 12:09, wrote: >> >> On Tue, Aug 20, 2013 at 5:04 AM, Nathaniel Smith wrote: >> > On 20 Aug 2013 01:39, "Joe Kington" wrote: >> >> >> >> >> >> >> >> >> >> ... >> >>> >> >>> >> >>> However, my first interpretation of an axis

Re: [Numpy-discussion] Adding an axis argument to numpy.unique

2013-08-20 Thread Nathaniel Smith
On 20 Aug 2013 12:09, wrote: > > On Tue, Aug 20, 2013 at 5:04 AM, Nathaniel Smith wrote: > > On 20 Aug 2013 01:39, "Joe Kington" wrote: > >> > >> > >> > >> > >> ... > >>> > >>> > >>> However, my first interpretation of an axis argument in unique would > >>> be that it treats each column (or what

Re: [Numpy-discussion] Adding an axis argument to numpy.unique

2013-08-20 Thread josef . pktd
On Tue, Aug 20, 2013 at 5:04 AM, Nathaniel Smith wrote: > On 20 Aug 2013 01:39, "Joe Kington" wrote: >> >> >> >> >> ... >>> >>> >>> 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, a

Re: [Numpy-discussion] Adding an axis argument to numpy.unique

2013-08-20 Thread Nathaniel Smith
On 20 Aug 2013 01:39, "Joe Kington" wrote: > > > > > ... >> >> >> 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. > > > Good point! > > That's certainly a potential

Re: [Numpy-discussion] Adding an axis argument to numpy.unique

2013-08-20 Thread Stéfan van der Walt
On Tue, Aug 20, 2013 at 2:39 AM, Joe Kington wrote: > 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

Re: [Numpy-discussion] Adding an axis argument to numpy.unique

2013-08-19 Thread Joe Kington
... > > 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. > Good point! That's certainly a potential source of confusion. However, I can't seem to come up with a bet

Re: [Numpy-discussion] Adding an axis argument to numpy.unique

2013-08-19 Thread josef . pktd
On Sun, Aug 18, 2013 at 7:14 PM, Joe Kington wrote: > Hi everyone, > > I've recently put together a pull request that adds an `axis` kwarg to > `numpy.unique` so that `unique`can easily be used to find unique > rows/columns/sub-arrays/etc of a larger array. > > https://github.com/numpy/numpy/pull/

[Numpy-discussion] Adding an axis argument to numpy.unique

2013-08-18 Thread Joe Kington
Hi everyone, I've recently put together a pull request that adds an `axis` kwarg to `numpy.unique` so that `unique`can easily be used to find unique rows/columns/sub-arrays/etc of a larger array. https://github.com/numpy/numpy/pull/3584 Currently, this works as a warpper around `unique`. If `axi