具有已知值的线性插值(不填充 Nan)



我有一些GPS数据,我正在尝试清理和插值一些列。我有一个秒列(派生自 GPS 不干净(、速度列和一个新的干净时间列。我想创建一个 VelInt 列,该列具有与新时间列对应的速度。我已经发布了快照。

Timestamp   Seconds Velocity    Acceleration    Odometer    Latitude    Longitude   Heart Rate  Player Load Time
81775   04/08/2019 15:17    8177.54 3.95    -0.450055   12749.89    -37.539804  143.847791  0   1167.5  8177.5
81776   04/08/2019 15:17    8177.64 4.05    -0.085043   12750.44    -37.539800  143.847793  0   1167.5  8177.6
81777   04/08/2019 15:17    8177.74 4.07    -0.033785   12750.89    -37.539796  143.847796  0   1167.6  8177.7
81778   04/08/2019 15:17    8177.84 4.04    -0.097840   12751.32    -37.539793  143.847798  0   1167.6  8177.8
81779   04/08/2019 15:17    8177.94 3.97    -0.235883   12751.78    -37.539789  143.847800  0   1167.6  8177.9

我相信我用以下内容解决了它

x = df_new4['Seconds']
xp = df_new4['Time']
fp = df_new4['Velocity']
df_new4['VelInt']=np.interp(x, xp, fp)

最新更新