I am working with a pandas dataframe, using df.groupby() was able to end in this that includes ['start_date'] and ['end_date'] and a value for an specific id.
| id | start_date | end_date |value|
|:-----------|------------======|:---------------|-----|
| 1 | 02-01-2018| 05-31-2018| 40|
| 2 | 01-01-2018| 03-31-2018| 12.3|
There is any
And this is the dataframe im trying to end with: ( value is value/nummonths between start_date and end_date)
|id | month_belongs | value|
|------------|------------------|------|
| 1 | 02-01-2018| 10|
| 1 | 03-01-2018| 10|
| 1 | 04-01-2018| 10|
| 1 | 05-01-2018| 10|
| 2 | 01-01-2018| 4.1|
| 2 | 02-01-2018| 4.1|
| 2 | 03-01-2018| 4.1|