Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread Charles R Harris
On Thu, May 6, 2010 at 11:25 AM, T J wrote: > Hi, > > Is there a way to sort the columns in an array? I need to sort it so > that I can easily go through and keep only the unique columns. > ndarray.sort(axis=1) doesn't do what I want as it destroys the > relative ordering between the various col

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread josef . pktd
On Thu, May 6, 2010 at 4:45 PM, T J wrote: > On Thu, May 6, 2010 at 10:36 AM,   wrote: >> >> there is a thread last august on unique rows which might be useful, >> and a thread in Dec 2008 for sorting rows >> >> something like >> >> np.unique1d(c.view([('',c.dtype)]*c.shape[1])).view(c.dtype).resh

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread T J
On Thu, May 6, 2010 at 10:36 AM, wrote: > > there is a thread last august on unique rows which might be useful, > and a thread in Dec 2008 for sorting rows > > something like > > np.unique1d(c.view([('',c.dtype)]*c.shape[1])).view(c.dtype).reshape(-1,c.shape[1]) > > maybe it's np.unique with nump

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread T J
On Thu, May 6, 2010 at 10:34 AM, Keith Goodman wrote: > On Thu, May 6, 2010 at 10:25 AM, T J wrote: >> Hi, >> >> Is there a way to sort the columns in an array?  I need to sort it so >> that I can easily go through and keep only the unique columns. >> ndarray.sort(axis=1) doesn't do what I want a

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread josef . pktd
On Thu, May 6, 2010 at 1:25 PM, T J wrote: > Hi, > > Is there a way to sort the columns in an array?  I need to sort it so > that I can easily go through and keep only the unique columns. > ndarray.sort(axis=1) doesn't do what I want as it destroys the > relative ordering between the various colum

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread Keith Goodman
On Thu, May 6, 2010 at 10:25 AM, T J wrote: > Hi, > > Is there a way to sort the columns in an array?  I need to sort it so > that I can easily go through and keep only the unique columns. > ndarray.sort(axis=1) doesn't do what I want as it destroys the > relative ordering between the various colu

[Numpy-discussion] Remove duplicate columns

2010-05-06 Thread T J
Hi, Is there a way to sort the columns in an array? I need to sort it so that I can easily go through and keep only the unique columns. ndarray.sort(axis=1) doesn't do what I want as it destroys the relative ordering between the various columns. For example, I would like: [[2,1,3], [3,5,1], [0