【发布时间】:2022-08-22 04:22:41
【问题描述】:
我有两张桌子 A) 包含“条目号”和“金额” B) 包含“From Entry number”和“To Entry Number”和“Created Date”
然后我想加入两者,但我没有特定的连接键,因为表 A 具有特定的“条目号” - 例如“1000”,但表 B 有间隔,例如“从条目号\" \"900\" 和\"到条目号\" \"1100\"。在 SQL 中,我可以将它们加入为:
select * from table A
left join table B
on a.[Entry number] >= b.[From Entry number] and a.[Entry number] <= b.[To Entry number]
但是我怎样才能实现 Pandas 呢?
-
查看here 以获取可能的解决方案
-
我看过那个解决方案,但是你有一些通用的连接键,我没有这种情况。
-
请提供具有预期输出的示例数据框