[英]If one dataframe value exists in another dataframe, then get a value from the dataframe
[英]Get approx value from dataframe
我想获得表中不存在的给定“LapTimeSeconds”的“距离”值,有什么办法吗?
也许使用插值? 但是怎么办? 提前致谢
# Something like this?
driver1_tel.loc[(driver1_tel["LapTimeSeconds"] == (3.0)]
您可以在感兴趣的列上使用 scipy 的插值 function。 通过查看您所写的内容,它会 go 类似于:
from scipy import interpolate
x = df.LaptimeSecond
y = df.Distance
f = interpolate.interp1d(x, y)
ynew = f(3)
变量 ynew 将为您提供 3 秒单圈时间的插值距离。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.