Re: [Numpy-discussion] Regarding Matrices

2006-08-15 Thread Alan G Isaac
> Torgil Svensson wrote: >> Shouldn't power() and the ** operator return the same result for matrixes? On Mon, 14 Aug 2006, Christopher Barker apparently wrote: > no, but the built-in pow() should -- does it? The "try it and see" approach says that it does. Cheers, Alan Isaac ---

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Andrew Straw
Sven Schreiber wrote: > Hi, > > Satya Upadhya schrieb: > > > from Numeric import * > > > Well this list is about the numpy package, but anyway... > This list is for numpy, numarray, and Numeric. There's just a lot more numpy talk going on these days, but "numpy-discussion"

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Christopher Barker
Torgil Svensson wrote: > Shouldn't power() and the ** operator return the same result for matrixes? no, but the built-in pow() should -- does it? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Travis Oliphant
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 >

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Torgil Svensson
>>> 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) m

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Nils Wagner
On Mon, 14 Aug 2006 21:58:50 +0200 Sven Schreiber <[EMAIL PROTECTED]> wrote: > Hi, > > 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

Re: [Numpy-discussion] Regarding Matrices

2006-08-14 Thread Sven Schreiber
Hi, 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

[Numpy-discussion] Regarding Matrices

2006-08-14 Thread Satya Upadhya
Dear All, Just a few queries regarding matrices. On my python shell i typed:   >>> from Numeric import *>>> from LinearAlgebra import *>>> A = [1,2,3,4,5,6,7,8,9]>>> B = reshape(A,(3,3))>>> Barray([[1, 2, 3],   [4, 5, 6],   [7, 8, 9]])>>> X = identity(3)>>> Xarray([[1, 0, 0],   [0, 1