Michael Roszkowski
Michael Roszkowski

Reputation: 25

Reading Charcter Values/Strings from CSV sheet

I am having trouble reading a character values/string values from my CSV sheet. I am trying to transfer the data from excel into this functionpsspy.two_winding_chang_4. Psspy comes from the simulation software PSSE. Its not working. I am receiving an error. The 3rd element of that function in that array is where I am trying to place the data. The variable is called digit My excel sheet is posted as well.Excel Sheet

Traceback (most recent call last):
File "C:\Users\RoszkowskiM\Desktop\win4.py", line 141, in <module>
psspy.two_winding_chng_4(from_,to,'{}'.format(digit),[_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i],[_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f, max_value, min_value,_f,_f,_f],[])
File ".\psspy.py", line 25588, in two_winding_chng_4
Two_Winding_Chng_4Error: two_winding_chng_4 Error: ierr=2
TypeError: an integer is required
ValueError: invalid literal for int() with base 10: 'T1'
>>> 

-

 for row in data:
     data_location,empty, year_link, from_, to,digit,name2,tla_2,min_value,max_value = row[5:15]
     output = 'From Bus #: {}\tTo Bus #: {}\t Area Station: {}\t VMIN: {} pu\tVMAX: {} pu\t'
     if year_link == year and tla_2==location:
        from_=int(from_)
        to=int(to)
        min_value=float(min_value)
        max_value=float(max_value)

        print(output.format(from_, to,name2, min_value, max_value))
        _i=psspy.getdefaultint()
        _f=psspy.getdefaultreal()
        psspy.two_winding_chng_4(from_,to,'{}'.format(digit),[_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i,_i],[_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f, max_value, min_value,_f,_f,_f],[])

else:
    exit

Upvotes: 0

Views: 63

Answers (0)

Related Questions