I used pandas to read the csv file and was able to create a dictionary from it but need to create the dictionary as a specific format.
flightinfo = pd.read_csv('flightdata.csv',quotechar='"',names=['starting_airport', 'destination_airport', 'airline', 'time', 'start_state','end_state'], header=None)
flightinfodict = flightinfo.to_dict(orient='records')
this gives the output
[{'starting_airport': 'Hilo International Airport', 'destination_airport': 'Boise Airport ', 'airline': 'delta', 'average_time_taken': 300, 'start_state': 'HAWAII', 'end_state': 'IDAHO'}
but the output i need is
{'Hilo International Airport' : {'destination_airport': 'Boise Airport ', 'airline': 'delta', 'average_time_taken': 300}
how can i modify the code to produce this output
thanks