I'm trying to use np.polyfit
and I keep getting the error:
TypeError: polyfit() got an unexpected keyword argument 'w'
The documentation on that function clearly mentions this argument so I'm not sure whats going on. I'm using SciPy 0.12.0
and NumPy 1.6.1
.
Here's a MWE that returns that error:
import numpy as np
x = np.array([0.0, 1.0, 2.0, 3.0, 4.0, 5.0])
y = np.array([0.0, 0.8, 0.9, 0.1, -0.8, -1.0])
weight = np.array([0.2, 0.8, 0.4, 0.6, 0.1, 0.3])
poli = np.polyfit(x, y, 3, w=weight)