I can load the files from each month between 201501 and 202008 via
# list all months
def iterate_months(start_ym, end_ym):
for ym in range(int(start_ym), int(end_ym) + 1):
if ym % 100 > 12 or ym % 100 == 0:
continue
yield str(ym)
yyyymm = list(iterate_months('201501', '202008'))
# load the files from each month
for i in range(len(yyyymm)):
Research_files[i] = sorted(glob.glob('Research_observations'+yyyymm[i]+'*.csv'))
But the variable name Research_files[i]
does not show the year and month directly. This is a problem when there are too many months.
Is there a way to name them as "Research_file_201501", "Research_file_201502"..."Research_file_202008" automatically when loaded?