I would like to create a loop that returns for each month during the provide time period, the first day and last day (taking into account that months end on the 28th-31st day): ("function_to_increase_month" is not defined yet)
for beg in pd.date_range('2014-01-01', '2014-06-30', freq='1M'):
period_start = beg
period_end = function_to_increase_month(beg)
The expected output being for the first iteration: period_start = '2014-01-01' period_end = '2014-01-31'
Second Iteration: period_start = '2014-02-01' period_end = '2014-02-28'
Third Iteration: period_start = '2014-03-01' period_end = '2014-03-31'
Can anyone suggest an approach?