I have one dataframe(df1) which is my raw data from which i want to filter or extract a part of the data. I have another dataframe(df2) which have my filter conditions. The catch here is my filter condition column if blank should skip tht column condition and move to the other column conditions
Example below:
DF1:
City | District | Town | Country | Continent |
---|---|---|---|---|
NY | WASHIN | DC | US | America |
CZCH | SEATLLE | DC | CZCH | Europe |
NY | MARYLAND | DC | US | S America |
NY | WASHIN | NY | US | America |
NY | SEAGA | NJ | UK | Europe |
DF2:(sample filter condition table - this table can have multiple conditions)
City | District | Town | Country | Continent |
---|---|---|---|---|
NY | DC | |||
NJ |
Notice that i have left the district, country and continent column blank. As I may or may not use it later. I cannot delete these columns.
OUTPUT DF: should look like this
City | District | Town | Country | Continent |
---|---|---|---|---|
NY | WASHIN | DC | US | America |
NY | MARYLAND | DC | US | S America |
NY | SEAGA | NJ | UK | Europe |
So basically i need a filter condition table which will extract information from the raw data for fields i input in the filter tables. I cannot change/delete columns in DF2. I can only leave the column blank if i dont require the filter condition.
Thanks in advance, Nitz