I have this dataframe:
keywords = ['a', 'a', 'a','a', 'b', 'c', 'c']
category = ['ads', 'organic', 'ads','organic','organic', 'ads', 'organic']
month = ['01', '01','02','02','02','03','03']
pd.DataFrame({'keywords': keywords, 'category': category, 'month':month})
keywords category month
0 a ads 01
1 a organic 01
2 a ads 02
3 a organic 02
4 b organic 02
5 c ads 03
6 c organic 03
There are more metrics such as search volume and keyword difficulty.
What I need to do is only keep the rows where a given keyword is both ads and organic during the same month.
There should be a df like this:
keywords category month
0 a ads 01
1 a organic 01
2 a ads 02
3 a organic 02
4 c ads 03
5 c organic 03