[Numpy-discussion] suggestions for Matrix-related changes

Keith Goodman kwgoodman at gmail.com
Tue Jul 11 21:50:46 CDT 2006


On 7/11/06, David Huard <david.huard at gmail.com> wrote:
>
>
> 2006/7/11, JJ <josh8912 at yahoo.com>:
> > 1) is it possible to get the function unique() to work with matrices,
> perhaps
> > with a unique_rows() function to work with matrices of more than one
> column?
>
>
> The problem is that applying unique to different rows will return vectors
> with different lengths. So you could not return an array, much less a
> matrix.

...unless it returned the unique rows instead of the unique elements
in each row. So if the matrix is

1 2 2
3 4 5
1 2 2

then the unique rows would be

1 2 2
3 4 5




More information about the Numpy-discussion mailing list