Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
Now I am receiving aother error. ValueError: need more than 1 value to unpack


import psspy
import excelpy
xlsfile=r'C:\Users\RoszkowskiM\Documents\PSSEEXPORT.xlsx'
testxls=excelpy.workbook(xlsfile,mode='r')

mydict = {}
for row in xlsfile:
    year,busnum,busname,change,tla,location = row[0:760]

# convert the types from string to Python numbers

change= float(change)
bus = int(busnum)

     #If this is a year not seen before, add it to the dictionary
     if year not in mydict:
        mydict[year] = {}

busses_in_year = mydict[year]
 if location not in busses_in_year:
       busses_in_year[location] = []


 #Add the bus to the list of busses that stop at this location
busses_in_year[location].append((busnum,busname,change))