when I try running the LSQUnivariateSpline function from scipy.interpolate on both the Nonlin notebook and my homework, I get the following error:
`ValueError Traceback (most recent call last) in ()
2
3 knots = [33, 50]
----> 4 spl_wage = LSQUnivariateSpline(age.values, wage.values, knots, k=3)
5
6 age_vec = np.linspace(age.values.min(), age.values.max(), 1000)
/Users/josephdenby/anaconda/lib/python3.6/site-packages/scipy/interpolate/fitpack2.py in init(self, x, y, t, w, bbox, k, ext, check_finite)
736 raise ValueError("Input(s) must not contain NaNs or infs.")
737 if not all(diff(x) > 0.0):
--> 738 raise ValueError('x must be strictly increasing')
739
740 # _data == x,y,w,xb,xe,k,s,n,t,c,fp,fpint,nrdata,ier
ValueError: x must be strictly increasing`
I've tried reordering the x vector a number of ways, but I can't seem to shake the problem. Does anyone have any suggestions?
when I try running the
LSQUnivariateSplinefunction fromscipy.interpolateon both the Nonlin notebook and my homework, I get the following error:`ValueError Traceback (most recent call last) in ()
2
3 knots = [33, 50]
----> 4 spl_wage = LSQUnivariateSpline(age.values, wage.values, knots, k=3)
5
6 age_vec = np.linspace(age.values.min(), age.values.max(), 1000)
/Users/josephdenby/anaconda/lib/python3.6/site-packages/scipy/interpolate/fitpack2.py in init(self, x, y, t, w, bbox, k, ext, check_finite)
736 raise ValueError("Input(s) must not contain NaNs or infs.")
737 if not all(diff(x) > 0.0):
--> 738 raise ValueError('x must be strictly increasing')
739
740 # _data == x,y,w,xb,xe,k,s,n,t,c,fp,fpint,nrdata,ier
ValueError: x must be strictly increasing`
I've tried reordering the x vector a number of ways, but I can't seem to shake the problem. Does anyone have any suggestions?