Interpolate Question

后端 未结 2 1018
野的像风
野的像风 2020-12-20 19:57
import re    
from decimal import *    
import numpy    
from scipy.signal import cspline1d, cspline1d_eval    
import scipy.interpolate    
import scipy    
import          


        
相关标签:
2条回答
  • 2020-12-20 20:25

    The X value 0.029999999999999999 occurs twice, with two different Y coordinates. It wouldn't surprise me if that caused a problem trying to fit a polynomial spline segment....

    0 讨论(0)
  • 2020-12-20 20:52

    I believe it's due to the X1 values not being ordered from smallest to largest plus also you have one duplicate x point, i.e, you need to sort the values for X1 and Y1 before you can use the splrep and remove duplicates.

    splrep from the docs seem to be low level access to FITPACK libraries which expects a sorted, non-duplicate list that's why it returns an error

    interpolate.interp1d might seem to work, but have you actually tried to use it to find a new point? I think you'll find an error when you call it i.e. rep(2)

    0 讨论(0)
提交回复
热议问题