Ask Your Question
0

Loadflow Automation

asked 2018-02-23 23:57:05 -0600

PSSE_ABCD gravatar image

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-02-24 23:37:22 -0600

Ali gravatar image

updated 2018-02-25 01:09:44 -0600

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

Stats

Asked: 2018-02-23 23:57:05 -0600

Seen: 498 times

Last updated: Feb 25 '18