【发布时间】:2021-10-03 14:03:47
【问题描述】:
我对 scipy.interpolate.interp1d 有疑问
df =
ang frc
-40 -15605.47
-30 -16051.253
-20 -10895.4
-10 -6205.733
0 -1730.65
10 2697.85
20 7217.59
30 12022.48
40 17298.647
import pandas as pd
from scipy.interpolate import interp1d
df = pd.read_csv('111.txt', sep='\t')
print(df)
interpi = interp1d(df['frc'], df['ang'], fill_value='extrapolate')
print(interpi(-17000))
它提供 import pandas as pd 从 scipy.interpolate 导入 interp1d
df = pd.read_csv('111.txt', sep='\t') 打印(df) interpi = interp1d(df['frc'], df['ang'], fill_value='extrapolate') 打印(interpi(-17000))
It gives -8.717 which is clearly wrong!
I rather it gives Error
can anyone help?
【问题讨论】:
标签: python pandas dataframe scipy