Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Your question is mainly concerned on how to read all of the files in a loop. You need to construct file names in a loop and read each file. The following code snippet may be helpful:

for i in range(1,49): 
    loadFileName = 'D'+str(i)+'.csv'
    load = pd.read_csv(loadFileName')
    genFileName = 'G'+str(i)+'.csv'
    gens = pd.read_csv(genFileName')

and then you can do whatever you want with the data in dataframe format.

Your question is mainly concerned on how to read all of the files in a loop. You need to construct file names in a loop and read each file. The following code snippet may be helpful:

for i in range(1,49): 
    loadFileName = 'D'+str(i)+'.csv'
    load = pd.read_csv(loadFileName')
pd.read_csv(loadFileName)
    genFileName = 'G'+str(i)+'.csv'
    gens = pd.read_csv(genFileName')
pd.read_csv(genFileName)

and then you can do whatever you want with the data in dataframe format.