[Numpy-discussion] Automatic matrices
kwgoodman at gmail.com
Thu Dec 21 16:00:55 CST 2006
On 12/21/06, Sven Schreiber <svetosch at gmx.net> wrote:
> Keith Goodman schrieb:
> > How about diag?
> There was a thread about this (in which you participated, I believe);
> for matrices you should now use m.diagonal() I think. So diag doesn't
I think the different results returned by x.diagonal and M.diagonal(x)
[-1.7135918 , -1.5183181 ]])
matrix([[-0.87175207, -1.5183181 ]]) <-----matrix
array([-0.87175207, -1.5183181 ]) <-----array
321 def diagonal(a, offset=0, axis1=0, axis2=1):
322 """diagonal(a, offset=0, axis1=0, axis2=1) returns the given diagonals
323 defined by the last two dimensions of the array.
325 return asarray(a).diagonal(offset, axis1, axis2)
Maybe this asarray could be changed to asanyarray?
More information about the Numpy-discussion