I have a pandas dataframe with some beginning and ending dates.
ActualStartDate ActualEndDate
0 2019-06-30 2019-08-15
1 2019-09-01 2020-01-01
2 2019-08-28 2019-11-13
Given these start & end dates I need to count how many days in each month between beginning and ending dates. I can't figure out a good way to approach this, but resulting dataframe should be something like:
ActualStartDate ActualEndDate 2019-06 2019-07 2019-08 2019-09 2019-10 2019-11 2019-12 2020-01 etc
0 2019-06-30 2019-08-15 1 31 15 0 0 0 0 0
1 2019-09-01 2020-01-01 0 0 0 30 31 30 31 1
2 2019-08-28 2019-11-13 0 0 4 30 31 13 0 0
Note that actual dataframe has ~1,500 rows with varying beginning & end dates. Open to different df output, but showing the above to give you the idea of what I need to accomplish. Thank you in advance for any help!