0

我无法从我的 CSV 表中读取字符值/字符串值。我正在尝试将数据从 excel 传输到此函数psspy.two_winding_chang_4中。psspy来自模拟软件PSSE。它不工作。我收到一个错误。该数组中该函数的第三个元素是我试图放置数据的位置。该变量称为digit我的 excel 表也已发布。电子表格

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
4

0 回答 0