This short script will help you create a range of dates that look like this 201203,201205,201306...
.
# set the date range from the minimum to the maximum # starting with a list of string dates def _set_date_range(list_dates): # convert all to integers list_int_dates = [int(x) for x in list_dates] # find minimum int_date = min(list_int_dates) # output list list_output_dates = [] while int_date < max(list_int_dates): list_output_dates.append(int_date) # get the last two digits (month) int_month = int(str(int_date)[-2:]) if int_month<12: int_date+=1 elif int_month==12: int_date+=89 # return output list return list_output_dates