Python Pandas: How to merge based on an “OR” condition?
问题 Let's say I have two dataframes, and the column names for both are: table 1 columns: [ShipNumber, TrackNumber, ShipDate, Quantity, Weight] table 2 columns: [ShipNumber, TrackNumber, AmountReceived] I want to merge the two tables based on both ShipNumber and TrackNumber. However, if i simply use merge in the following way (pseudo code, not real code): tab1.merge(tab2, "left", on=['ShipNumber','TrackNumber']) then, that means the values in both ShipNumber and TrackNumber columns from both