Re: [Numpy-discussion] unique 2d arrays

2010-09-21 Thread Ernest Adrogué
21/09/10 @ 12:55 (-0500), thus spake Gökhan Sever: > On Tue, Sep 21, 2010 at 12:43 PM, wrote: > > > I'm a bit surprised, I think np.unique does some extra work to > > maintain the order. > > The tolist() might not be necessary if you iterate over rows. > > > > Testing again with a smaller k arra

Re: [Numpy-discussion] unique 2d arrays

2010-09-21 Thread Gökhan Sever
On Tue, Sep 21, 2010 at 12:43 PM, wrote: > I'm a bit surprised, I think np.unique does some extra work to > maintain the order. > The tolist() might not be necessary if you iterate over rows. > Testing again with a smaller k array and more repeats I[25]: k = np.array((a.tolist()*5000)) I[27]:

Re: [Numpy-discussion] unique 2d arrays

2010-09-21 Thread josef . pktd
On Tue, Sep 21, 2010 at 1:29 PM, Gökhan Sever wrote: > > > On Tue, Sep 21, 2010 at 1:55 AM, Peter Schmidtke > wrote: >> >> Dear all, >> >> I'd like to know if there is a pythonic / numpy way of retrieving unique >> lines of a 2d numpy array. >> >> In a way I have this : >> >> [[409 152] >>  [409

Re: [Numpy-discussion] unique 2d arrays

2010-09-21 Thread Gökhan Sever
On Tue, Sep 21, 2010 at 1:55 AM, Peter Schmidtke wrote: > Dear all, > > I'd like to know if there is a pythonic / numpy way of retrieving unique > lines of a 2d numpy array. > > In a way I have this : > > [[409 152] > [409 152] > [409 152] > [409 152] > [409 152] > [409 152] > [409 152] > [

Re: [Numpy-discussion] unique 2d arrays

2010-09-21 Thread Peter Schmidtke
Hey Josef, I didn't stumble upon these posts. Thanks for the hint...it doesn't look very pythonic or matlab like still. This would be a nice thing to have a unique function that is able to take an axis argument. Cheers. Peter josef.p...@gmail.com wrote: > On Tue, Sep 21, 2010 at 2:55 AM, Peter

Re: [Numpy-discussion] unique 2d arrays

2010-09-21 Thread josef . pktd
On Tue, Sep 21, 2010 at 2:55 AM, Peter Schmidtke wrote: > Dear all, > > I'd like to know if there is a pythonic / numpy way of retrieving unique > lines of a 2d numpy array. > > In a way I have this : > > [[409 152] >  [409 152] >  [409 152] >  [409 152] >  [409 152] >  [409 152] >  [409 152] >  [

[Numpy-discussion] unique 2d arrays

2010-09-20 Thread Peter Schmidtke
Dear all, I'd like to know if there is a pythonic / numpy way of retrieving unique lines of a 2d numpy array. In a way I have this : [[409 152] [409 152] [409 152] [409 152] [409 152] [409 152] [409 152] [409 152] [409 152] [409 152] [409 152] [426 193] [431 129]] And I'd like to ge