On Thu, May 6, 2010 at 4:45 PM, T J tjhnson@gmail.com wrote:
On Thu, May 6, 2010 at 10:36 AM, josef.pktd@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 np.unique with numpy 1.4.
The thread is useful:
http://www.mail-archive.com/numpy-discussion@scipy.org/msg19830.html
I'll have to see if it is quicker for me to just do:
y = x.transpose().tolist() y.sort() x = np.array(y).transpose()
for sure it's easier to read. the difference might be temporary array creation compared to using numpy.sort on a view.
Josef
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion