Sep-01-2017, 06:44 PM
the goal of this code is to match
Unfortunately I receive this error:
year_link
and tla_2
and output variables from_, to, digit, name2, min_value, max_value
. I am using a CSV file, that's where the data is being read from. It is posted here:
Unfortunately I receive this error:
Error:Traceback (most recent call last):
File "C:/Users/RM/Desktop/win6.py", line 150, in <module>
for from_,to,digit,name2,min_value,max_value in voltage_envelopes[tla_2]:
ValueError: need more than 3 values to unpack.
data = list(csv.reader(open(LOAD_GEN_DATAFILE))) year = raw_input(" ") location=raw_input(" ") for row in data: year_link, from_,to,digit,name2,tla_2,min_value,max_value,last_bus = row[7:16] year_link = year tla_2=location if year_link not in mydict: mydict[year_link]={} voltage_envelopes=mydict[year_link] if tla_2 not in voltage_envelopes: voltage_envelopes[tla_2]=[] voltage_envelopes[tla_2].append((from_,to,digit,name2,min_value,max_value)) if year_link in mydict and tla_2 in mydict[year_link]: voltage_envelopes=mydict[year_link] for from_,to,digit,name2,min_value,max_value in voltage_envelopes[tla_2]: from_=int(from_) to=int(to) min_value=float(min_value) max_value=float(max_value) digit=int(digit) output = 'From Bus #: {}\tTo Bus #: {}\t Area Station: {}\t VMIN: {} pu\tVMAX: {} pu\t' print(output.format(from_, to,name2, min_value, max_value)) print("\n") #_c=psspy.getdefaultchar() #_i=psspy.getdefaultint() #_f=psspy.getdefaultreal() #psspy.two_winding_chng_4(from_,to,'%d'% 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