我的数据框看起来像这样:
-------record_timestamp client_timestamp button state x y
33507 15564.465 15564.563 NoButton Move 526 539
33508 15564.682 15564.657 NoButton Move 822 524
33509 15564.682 15564.766 NoButton Move 1068 455
33510 15564.794 15564.891 NoButton Move 1067 386
33511 15564.907 15565.000 NoButton Move 1017 358
33512 15565.124 15565.094 NoButton Move 951 359
33513 15565.124 15565.218 NoButton Move 929 361
33514 15565.505 15565.593 NoButton Move 912 360
33515 15565.649 15565.733 NoButton Move 912 359
33516 15566.785 15566.872 NoButton Move 912 358
33517 15567.037 15567.122 NoButton Move 912 357
33518 15571.179 15571.271 NoButton Move 911 357
33519 15572.109 15572.207 NoButton Move 909 355
33520 15573.119 15573.206 NoButton Move 909 353
33521 15577.089 15577.184 NoButton Move 907 353
33522 15577.417 15577.277 NoButton Move 882 353
33523 15577.417 15577.496 NoButton Move 878 353
33524 15578.188 15578.276 NoButton Move 876 357
33525 15583.195 15583.283 NoButton Move 875 357
33526 15583.402 15583.377 NoButton Move 813 360
33527 15583.402 15583.486 NoButton Move 767 360
33528 15583.515 15583.611 NoButton Move 745 360
33529 15583.625 15583.720 NoButton Move 710 360
33530 15583.761 15583.845 NoButton Move 699 360
33531 15583.908 15584.001 NoButton Move 697 360
33532 15584.020 15584.110 NoButton Move 692 358
33533 15584.280 15584.375 NoButton Move 691 358
我想做的是:以某种方式在scipy中使用样条线类,并获得更好的视图和可区分性。我开始时是:
def interpolate(MM_data):
dt = 0.005
tstart = MM_data.client_timestamp.iloc[0]
tstop = MM_data.client_timestamp.iloc[-1]
nsteps = (tstop - tstart) / dt + 1
tt = np.linspace(tstart, tstop, nsteps)
我想根据“ tt”向量对数据重新采样。我该怎么办?