KDB+ like asof join for timeseries data in pandas?
kdb+ has an aj function that is usually used to join tables along time columns. Here is an example where I have trade and quote tables and I get the prevailing quote for every trade. q)5# t time sym price size ----------------------------- 09:30:00.439 NVDA 13.42 60511 09:30:00.439 NVDA 13.42 60511 09:30:02.332 NVDA 13.42 100 09:30:02.332 NVDA 13.42 100 09:30:02.333 NVDA 13.41 100 q)5# q time sym bid ask bsize asize ----------------------------------------- 09:30:00.026 NVDA 13.34 13.44 3 16 09:30:00.043 NVDA 13.34 13.44 3 17 09:30:00.121 NVDA 13.36 13.65 1 10 09:30:00.386 NVDA 13.36 13.52 21