I have dataframe with three columns name, content and day
df
content day name
0 first_day 01-01-2017 marcus
1 present 10-01-2017 marcus
2 first_day 01-02-2017 marcus
3 first_day 01-03-2017 marcus
4 absent 05-03-2017 marcus
5 present 20-03-2017 marcus
6 first_day 01-04-2017 bruno
7 present 11-04-2017 bruno
8 first_day 01-05-2017 bruno
9 absent 02-05-2017 bruno
10 first_day 01-06-2017 bruno
11 absent 02-06-2017 bruno
12 payment 09-06-2017 bruno
I'm trying to find out users month wise whose rows has first_day,absent and present continuously.
Sample output:
content day name absent_after_present
0 first_day 01-01-2017 marcus False
1 first_day 01-02-2017 marcus False
2 first_day 01-03-2017 marcus True
3 first_day 01-04-2017 bruno False
4 first_day 01-05-2017 bruno False
5 first_day 01-06-2017 bruno True
Ex: marcus has first_day,absent and present continuously from 01-03-2017,05-03-2017 and
20-03-2017 in the same month. So marcus status should be True