I have a list of lists that I want to loop over, each time removing each lists contents and using those contents to filter a dataframe.
for channel,country in params[:1]:
print(df[(df.channel == channel) & (df.region_sub == country)])
I know the above doesn't work and I believe it's the way I am passing 'channel and 'country' into the loop, but not sure how to correct this.
sample data from params list:
[['on-platform', 'USA'],
['on-platform', 'Brazil'],
['on-platform', 'Israel']]
I would also like to store the filter dataframe to a new dataframe with a simple naming convention that indexes from df_1 to df_n
The df_n would look like something with date, channel, country as the main attributes. It is essentially just df filtered