1>>> left = pd.DataFrame({"a": [1, 5, 10], "left_val": ["a", "b", "c"]})
2>>> left
3 a left_val
40 1 a
51 5 b
62 10 c
7
8>>> right = pd.DataFrame({"a": [1, 2, 3, 6, 7], "right_val": [1, 2, 3, 6, 7]})
9>>> right
10 a right_val
110 1 1
121 2 2
132 3 3
143 6 6
154 7 7
16
17>>> pd.merge_asof(left, right, on="a")
18 a left_val right_val
190 1 a 1
201 5 b 3
212 10 c 7