Torgil Svensson wrote: >>>> import numpy >>>> numpy.__version__ >>>> > '1.0b1' > >>>> from numpy import * >>>> A = [1,2,3,4,5,6,7,8,9] >>>> B = asmatrix(reshape(A,(3,3))) >>>> B >>>> > matrix([[1, 2, 3], > [4, 5, 6], > [7, 8, 9]]) > >>>> B**0 >>>> > matrix([[ 1., 0., 0.], > [ 0., 1., 0.], > [ 0., 0., 1.]]) > >>>> power(B,0) >>>> > matrix([[1, 1, 1], > [1, 1, 1], > [1, 1, 1]]) > > Shouldn't power() and the ** operator return the same result for matrixes? > No. power is always the ufunc which does element-by-element raising to a power. This is actually a feature in that you can use the function call to do raising to a power without caring what kind of array subclass is used.
In the same manner, multiply is *always* the ufunc. -Travis ------------------------------------------------------------------------- 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