Alan G Isaac wrote: >On Fri, 23 Jun 2006, Keith Goodman apparently wrote: > > >>my x is a Nx1 matrix. I can't get it to work with matrices. >> >> > >Hmm. One would think that diag() would accept a flatiter >object, but it does not. Shouldn't it?? > >
It doesn't? try: a = rand(3,4) diag(a.flat).shape which prints (12,12) for me. Also: >>> a = ones((2,3)) >>> diag(a.flat) array([[1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1]]) Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion