[Numpy-discussion] unique along axis?

325 views
Skip to first unread message

Neal Becker

unread,
Mar 12, 2012, 3:04:41 PM3/12/12
to numpy-di...@scipy.org
I see unique does not take an axis arg.

Suggested way to apply unique to each column of a 2d array?

_______________________________________________
NumPy-Discussion mailing list
NumPy-Di...@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Ralf Gommers

unread,
Mar 16, 2012, 6:00:31 PM3/16/12
to Discussion of Numerical Python
On Mon, Mar 12, 2012 at 8:04 PM, Neal Becker <ndbe...@gmail.com> wrote:
I see unique does not take an axis arg.

Suggested way to apply unique to each column of a 2d array?

A for-loop?

I'm guessing that there isn't an axis keyword because the number of unique elements per column may not be the same, so you can't return an ndarray.

Ralf

Reply all
Reply to author
Forward
0 new messages