0

Loadflow Automation

Hi I have over 48 load flow dispatches to analyse of various generation & load profiles, and I would like to automate the run in one go by looping all the cases in my folder. At the moment the cases are in separate .csv files, and I have manage to automate one simulation and export the results. At the moment for every dispatch case I have given a number i.e. G1.csv & D1.csv all the way to G48.csv & D48.csv in my folder. How do I automate it this? or loop it through my folder ? Any existing python code you can share will be the ultimate help.

Thanks

PSSE_ABCD's avatar
11
PSSE_ABCD
asked 2018-02-23 23:57:05 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

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.

Ali's avatar
26
Ali
answered 2018-02-24 23:37:22 -0500, updated 2018-02-25 01:09:44 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Login/Signup to Answer