Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Something like this does the job. After calling this function, write the following line: volviol.to_csv('voltage.csv') and that should do it.

 def voltages_csv():
    # get a dataframe of all buses and their voltages; you need to write this function
    allBusData = AllBuses()
    volviol = []
    for index, iBus in allBusData.iterrows():
        busName = iBus['exname']
        busArea = iBus['area']
        busMag = iBus['kv']
        busAng = iBus['angled']
        busKv = iBus['base']
        busPu = iBus['pu']
        if not (0.95 <= busPu <= 1.05):
            volviol.append(iBus)
    volviolDF = pd.DataFrame(data=volviol)
    return volviolDF

Something like this does the job. After calling this function, write the following line: volviol.to_csv('voltage.csv') and that should do it.

 def voltages_csv():
    # get a dataframe of all buses and their voltages; you need to write this function
    allBusData = AllBuses()
    volviol = []
    for index, iBus in allBusData.iterrows():
        busName = iBus['exname']
        busArea = iBus['area']
        busMag = iBus['kv']
        busAng = iBus['angled']
        busKv = iBus['base']
        busPu = iBus['pu']
        if not (0.95 <= busPu <= 1.05):
            volviol.append(iBus)
    volviolDF = pd.DataFrame(data=volviol)
    return volviolDF