I am trying to solve a pandas problem for data analysis. I have 2 csv files that I have loaded into 2 separate data frames. Lets call them df1 and df2.
There is a reference (master data) column in df1 that has a master list of unique codes. In df2, I have 2 separate columns with values that I need to validate against this master column in df1. Something similar to a vlookup.
Example:
df1['master_column'] has values ['123', '456','789']
df2 has 2 columns with multiple values but only those rows need to be retained whose values match df1 column values above. The check needs to happen for both the columns in df2. I tried using merge (similar to inner join) but I guess that will only let me join one column from df2 with df1 and I need to apply the join condition with 2 columns. Not sure if I have explained correctly.