I have two pandas tables:
Table1
PosA PosB PosC
1 100 110
1 300 350
4 100 120
Table2
PosA PosD
1 105
2 305
4 115
5 308
I want to extract all information from Table1, if PosD in Table2 is in range PosB and PosC AND PosA of Table1 and Table2 match extactly.
So the correct output is:
PosA PosB PosC PosD
1 100 110 105
4 100 120 115
How to merge this two tables, according this rules?