Hi, I'm running into an error with linear least squares that I'm not sure
what to do about.  For reference, I'm trying to fit a curve corresponding to
the example at the bottom of this wikipedia page:
http://en.wikipedia.org/wiki/Linear_least_squares

My code looks like this:

from numpy import *
import LinearAlgebra
A=array([0,1,2,1,4,1,-1,1])
A.shape=(4,2)
b=array([3,3,4,2])
b.shape= (4,1)
sol=LinearAlgebra.linear_least_squares(A,b)





And I'm getting the following error:
File "<stdin>", line 1, in ?
 File "/usr/lib/python2.4/site-packages/Numeric/LinearAlgebra.py", line
410, in linear_least_squares
   t =_commonType(a, b)
 File "/usr/lib/python2.4/site-packages/Numeric/LinearAlgebra.py", line 30,
in _commonType
   t = a.typecode()
AttributeError: 'numpy.ndarray' object has no attribute 'typecode'
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to