回答編集履歴

1

修正

2020/08/03 09:05

投稿

can110
can110

スコア38266

test CHANGED
@@ -58,25 +58,25 @@
58
58
 
59
59
 
60
60
 
61
- df = pd.merge_asof(df1, df2, on='time')
61
+ df = pd.merge_asof(df1, df2, on='time', direction='nearest')
62
62
 
63
63
  print(df)
64
64
 
65
65
  """
66
66
 
67
- time Y Z
67
+ time Y Z
68
68
 
69
- 0 0.0 3 4
69
+ 0 0.0 3 4
70
70
 
71
- 1 0.5 5 10
71
+ 1 0.5 5 3
72
72
 
73
- 2 1.0 4 4
73
+ 2 1.0 4 4
74
74
 
75
- 3 1.5 8 6
75
+ 3 1.5 8 9
76
76
 
77
- 4 2.0 10 1
77
+ 4 2.0 10 1
78
78
 
79
- 5 2.5 7 3
79
+ 5 2.5 7 5
80
80
 
81
81
  """
82
82