python - Not outputting any values -
my code seems not working properly. goal year , location match in same row, , print out information associated row. code posted below excel sheet reading data.
load_gen_datafile = 'c:\users\roszkowskim\desktop\data_2016.csv' # csv file read open(load_gen_datafile) csvfile: reader = csv.dictreader(csvfile) mydict={} row in reader: year=row['year'] busnum=row['busnum'] area=row['area'] power=row['power'] tla=row['tla'] location=row['location'] yearlink=row['yearlink'] from=row['from'] to=row['to'] max=row['max'] min=row['min'] year = raw_input("please select year of study: ") print("\n") commands = ["millwood-buchanan", "astoria-east-corona", "bronx", "dunwoodie-north-sherman_creek", "vernon", "greenwood-statenisland","west_49th","east_13th","staten_island","east_river", "east_view","dunwoodie-south","corona-jamaica","astoria-east-corona-jamaica", "astoria-west-queensbridge-vernon","astoria-west-queensbridge"] max_columns = 50 index, commands in enumerate(commands): stars_amount = max(max_columns - len(commands), 0) row = "# {} {}({})".format(commands, "." * stars_amount, index + 1) print(row) location=raw_input(" \n list above show tla pockets id numbers assigned them ()\n\n please enter id #: ") print("\n") if year==year , location==location: mydict=[busnum,area,power] print("here busses @ location year , new load total: ") print("\n") busnum,area,power in mydict: power= float(scaled_power) busnum = int(busnum) print('bus #: %d\t' % busnum ,'area station: %s\t'% area,'new load total: %d mw\t' % power)
Comments
Post a Comment