python - 用python numpy插值

标签 python numpy interpolation


我有一组样本 y 和相应的 x 值。一些 y 值可能会丢失,我想使用线性插值来计算它们。使用 python 执行此操作的最佳方法是什么(我使用的是 numpy 数组)。如果您能提供一个示例代码,那就太好了。

谢谢

最佳答案

请参阅有示例的 numpy 文档中的插值方法:

http://docs.scipy.org/doc/numpy/reference/generated/numpy.interp.html

scipy 还提供了一组更广泛的方法:

http://docs.scipy.org/doc/scipy/reference/interpolate.html

关于python - 用python numpy插值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5446365/

相关文章:

Python - 以文本模式写入以二进制模式打开的文件

python - 在 TensorFlow.js 中切片 3d 张量

python - 我认为 scipy.interpolate 可能坏了还是我用错了?

python - 计算两点之间的逆时针角度

python - 更新 : Apply (vectorized) function on each cell to interpolate grid

python - 了解 scipy.interpolate 的 interpn 函数

python - 将 pandas DataFrame 中的对角三角形设置为 NaN

python - 登录 Scrapy

python - Anaconda:Python 是 64 位,numpy 32 位 -> 冲突。如何获得 numpy 64 位

python - PIL 图像未按正确顺序渲染输入的像素值