Skip to content

LSQUnivariateSpline Error #192

Description

@jgdenby

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?

Activity

khan1792 commented on Feb 18, 2018

@khan1792

The latest version of Scipy will cause this error. Installing the old version (before 0.19.1) can solve it.

tamos commented on Feb 19, 2018

@tamos

In Anaconda, you can downgrade your version by going to Environments, finding the package, then right-click, "Mark for specific installation" and pick the version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions