Re: [Numpy-discussion] objects are not aligned. Matrix and Array

2009-12-19 Thread Charles R Harris
On Sat, Dec 19, 2009 at 4:53 AM, Chris Colbert wrote: > > > On Sat, Dec 19, 2009 at 6:43 AM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Fri, Dec 18, 2009 at 10:20 PM, Wayne Watson < >> sierra_mtnv...@sbcglobal.net> wrote: >> >>> This program gives me the message followin

Re: [Numpy-discussion] objects are not aligned. Matrix and Array

2009-12-19 Thread Chris Colbert
On Sat, Dec 19, 2009 at 6:43 AM, Charles R Harris wrote: > > > On Fri, Dec 18, 2009 at 10:20 PM, Wayne Watson < > sierra_mtnv...@sbcglobal.net> wrote: > >> This program gives me the message following it: >> Program== >> import numpy as np >> from numpy import matrix >> imp

Re: [Numpy-discussion] objects are not aligned. Matrix and Array

2009-12-18 Thread Wayne Watson
Is math automatic (built-in)? Same result with np.dot(m2, m1). Ah, this works. dotres = np.dot(m2.T, m1). It looks to me like the shapes are the same, so maybe dot() requires one as a column vector and one as a row. Thanks. Charles R Harris wrote: > > > On Fri, Dec 18, 2009 at 10:20 PM, Wayne

Re: [Numpy-discussion] objects are not aligned. Matrix and Array

2009-12-18 Thread Charles R Harris
On Fri, Dec 18, 2009 at 10:20 PM, Wayne Watson wrote: > This program gives me the message following it: > Program== > import numpy as np > from numpy import matrix > import math > > You don't want math. > def sinD(D): # given in degrees, convert to radians >return ma

[Numpy-discussion] objects are not aligned. Matrix and Array

2009-12-18 Thread Wayne Watson
This program gives me the message following it: Program== import numpy as np from numpy import matrix import math def sinD(D): # given in degrees, convert to radians return math.sin(math.radians(D)) def cosD(D): return math.cos(math.radians(D)) r = math.sqrt(2*2+5*