Logarithmic interpolation in python

前端 未结 2 1865
小鲜肉
小鲜肉 2021-02-19 11:07

Using numpy.interp I am able to compute the one-dimensional piecewise linear interpolant to a function with given values at discrete data-points.

Is it a si

2条回答
  •  再見小時候
    2021-02-19 11:42

    If I am understanding you correctly, you have some discrete data that you want to get a smooth set of values that would arise in between the values you have. I am assuming you don't want an equation of a log function that approximates the data.

    Unfortunately numpy does not have anything outside of the linear piecewise interpolation, however if you look into using SciPy it does have a more powerful interpolation function. See SciPy's interpolate documentation for more detail.

    It includes more complex interpolations like 'cubic' interpolations which will give you very smooth approximations, but it won't be a logarithm and it won't give you an equation.

    If you want an equation what you are looking for is a regression technique not interpolation, but I don't think you are.

提交回复
热议问题