#importing the required libraries import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import matrixprofile as mp from matrixprofile import * mylist = [] for file in os.listdir('/Users/code/timeseries/ucr_competition_data/'): mylist.append(int(file[1683:1686])) df2 = pd.DataFrame(mylist, columns=['location']) df2.index.name = 'No.' df2.index += 1 df2.to_csv('submit.csv')