|
From: John H. <jdh...@ac...> - 2005-03-01 03:28:34
|
>>>>> "Axel" == Axel Kowald <A.K...@gm...> writes:
Axel> Hi, I'm using matplotlib 0.71 and I think I found a bug in
Axel> polyfit.
Axel> This simple linear regression on two data points gives the
Axel> correct answer:
>>>> polyfit([731.924,731.988],[915,742],1)
^^^^
floats
Axel> However, if I multiply my x values by 1000 the result is
Axel> wrong:
>>>> polyfit([731924,731988],[915,742],1)
^^^^
integers
Both of these should work
print polyfit([731.924,731.988],[915.,742.],1)
print polyfit([731924.,731988.],[915.,742.],1)
I fixed the polyfit code to explicitly convert the input arrays to
floats arrays, which fixes this bug.
Thanks for the report.
JDH
|