DF1:
time_1 a b c
0 1.675168e+09 -90.56 5.28 -6.23
1 1.675168e+09 -87.98 5.27 -5.68
2 1.675168e+09 -83.96 14.74 -9.44
3 1.675168e+09 -85.58 -5.72 -5.27
4 1.675168e+09 -95.13 -4.15 -5.46
5 1.675168e+09 -90.56 5.28 -6.23
6 1.675168e+09 -87.98 5.27 -5.68
7 1.675168e+09 -83.96 14.74 -9.44
8 1.675168e+09 -85.58 -5.72 -5.27
9 1.675168e+09 -95.13 -4.15 -5.46
DF2:
time_2 x y z
0 1.675168e+09 -6.64 542.397494 2.25
1 1.675168e+09 -6.64 541.233179 2.25
2 1.675169e+09 -6.63 567.644365 2.25
3 1.675169e+09 -6.63 530.368776 2.25
4 1.675170e+09 -6.63 552.896863 2.25
我想得到时间差,即df1中的time_1减去df2中的所有time_2值。
DF:
time_1 - time_2 a b c y
0 1.675168e+09 - 1.675168e+09
1 1.675168e+09 - 1.675168e+09
2 1.675168e+09 - 1.675169e+09
3 1.675168e+09 - 1.675169e+09
4 1.675168e+09 - 1.675170e+09
5
6
7
然后继续
2条答案
按热度按时间pcrecxhr1#
iqih9akk2#
根据您的评论更新,将
merge
与how='cross'
配合使用:您可以连接 Dataframe (基于索引):