[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],

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread Keith Goodman
On Thu, May 6, 2010 at 10:25 AM, T J tjhn...@gmail.com 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

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread josef . pktd
On Thu, May 6, 2010 at 1:25 PM, T J tjhn...@gmail.com 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

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread T J
On Thu, May 6, 2010 at 10:36 AM, josef.p...@gmail.com 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

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread josef . pktd
On Thu, May 6, 2010 at 4:45 PM, T J tjhn...@gmail.com wrote: On Thu, May 6, 2010 at 10:36 AM,  josef.p...@gmail.com 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

Re: [Numpy-discussion] Remove duplicate columns

2010-05-06 Thread Charles R Harris
On Thu, May 6, 2010 at 11:25 AM, T J tjhn...@gmail.com 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