def multiyear_periods(dt, years): start = datefuncs.start_of_month(dt.month, dt.year) finish = datetime.date(start.year + years, start.month, start.day) months = list(datefuncs.monthrange(start, finish)) columns = ['%sM%s' % (x[0], '%02d' % x[1]) for x in months] column_titles = columns return columns, column_titles
def multiyear_ends(dt, years): start = datefuncs.start_of_month(dt.month, dt.year) finish = datetime.date(start.year + years, start.month, start.day) months = list(datefuncs.monthrange(start, finish)) columns = [datefuncs.end_of_month(x[1], x[0]).isoformat() for x in months] column_titles = columns return columns, column_titles
def multiyear_ends(dt, years): start = datefuncs.start_of_month(dt.month, dt.year) finish = datetime.date(start.year + years, start.month, start.day) months = list(datefuncs.monthrange(start, finish)) columns = [datefuncs.end_of_month(x[1],x[0]).isoformat() for x in months] column_titles = columns return columns, column_titles