[Numpy-discussion] Regarding Matrices

Sven Schreiber svetosch at gmx.net
Mon Aug 14 14:58:50 CDT 2006


Satya Upadhya schrieb:

>>>> from Numeric import *

Well this list is about the numpy package, but anyway...

> the power function is giving a resultant matrix in which each element of
> matrix B is raised to the power of 0 so as to make it 1. But, taken as a
> whole i.e. matrix B to the power of 0 should have given the identity
> matrix.

afaik, in numpy terms if you are dealing with a numpy array, such
functions are elementwise by design.
In contrast, if you have a numpy matrix (a special subclass of the array
class) --constructed e.g. as mat(eye(3))-- then power is redefined to be
the matrix power; at least that's the rule for the ** operator, not 100%
sure if for the explicit power() function as well, but I suppose so.

> Also, what is the procedure for taking the log of an entire matrix
> (log(A) where A is a matrix takes the log of every individual element in
> A, but thats not the same as taking the log of the entire matrix)

I don't understand what you want, how do you take the log of a matrix


More information about the Numpy-discussion mailing list