Polyfit

Sæll

One mroe question from me today :slight_smile:

I have some trouble running polyfit with matplotlib-0.52
Can you please help me finding out what I do wrong
I give a list of x values and y values as well as the degree of the desired polynome. But all I get is the following error

x=[1,2,3]
y=[1,2,1]
polyfit(x,y,3)

Traceback (most recent call last):
  File "<<console>>", line 1, in ?
  File "/usr/lib/python2.2/site-packages/matplotlib/mlab.py", line 341, in polyfit
    X = Matrix(vander(x, N+1))
  File "/usr/lib/python2.2/site-packages/matplotlib/mlab.py", line 383, in vander
    X = ones( (len(x),N), x.typecode())
AttributeError: 'list' object has no attribute 'typecode'

Any idea ?

Thanks

Jean-Baptiste

···

--
-----------------------------
Jean-Baptiste.Cazier@...15...

Department of Statistics
deCODE genetics Sturlugata,8
570 2993 101 Reykjavík