I need to apply multiple filters to a pandas DataFrame in order to get various time series out of the filtered results.
The DataFrame looks like this:
Date Country Type Channel Metric1 Metric2 Metric3
0 2021-01-01 Ecuador A_type channel_1 1.0 2.3 1.3
1 2021-01-02 Ecuador A_type channel_1 2.0 4.5 1.2
2 2021-01-03 Ecuador B_type channel_1 3.0 4.3 3.5
...
I need to get some time series from the values of the Metric columns + Date, so in order to do so, i have the list of filters that look like this:
Country Type Channel Metric
0 Ecuador A_type channel_1 Metric1
1 Ecuador A_type channel_1 Metric2
2 Ecuador A_type channel_1 Metric3
3 Brazil A_type channel_1 Metric1
4 Brazil A_type channel_1 Metric2
...
And so on. My thought process is to loop through the dataframe, apply the filters from the list and append the obtained series to a list of series. The main part im stuck on is the dataframe filtering based on the list of filters. Can someone point me towards a direction here?
Thanks!