[Numpy-discussion] Automatic matrices

Keith Goodman kwgoodman at gmail.com
Thu Dec 21 11:13:54 EST 2006


On 12/21/06, Sven Schreiber <svetosch at gmx.net> wrote:
> Sven Schreiber schrieb:
> > Keith Goodman schrieb:
> >
> >> There are many numpy functions that will take a matrix as input but
> >> return an array.
> >>
> >> The nan functions (nanmin, nanmax, nanargmin, nanargmax, nansum) are an example.
> >>
> >
> > So that would be a bug IMHO and should be filed as a ticket. I will do
> > that eventually if nobody stops me first...
> >
>
> This is now ticket #405. Keith, you said "example", do you know of any
> other functions? Maybe you could add a comment to the ticket.

I'll look for more examples.

How about diag?

>> x

matrix([[ 0.82553498,  0.89115156],
        [ 0.106748  ,  0.21844565]])
>> M.diag(x)
array([ 0.82553498,  0.21844565])
>> M.asmatrix(M.diag(x)).T

matrix([[ 0.82553498],
        [ 0.21844565]])
>>



More information about the NumPy-Discussion mailing list