Abdulkabir_1 0 Newbie Poster

I want to consider Arrival Column and Departure, but let me consider the ARRIVAL. I have "Paris" and "Los Angeles", I want to create a dictionary that will deplay everything associated to the "Paris" and every that has to do "Los Angeles". In case they are more than more than just Paris and Los Angeles, it could be 10 i.e. Paris, Los Angeles, London, Dubai, Ontario, Japan etc. The code i have below can only produce the out i have below it

import pandas as pd
import datetime
import pandas.io.data
from pandas_datareader import data, wb

df = pd.read_csv('testfile.csv')
d= df.set_index('Arrival').T.to_dict('list').values()
print (d)

AuthorID Arrival Departure Date Time
1922 Paris New York 09/12/10 10:00:00 AM
1002 Los Angeles California 02/12/09 09:00:00 AM
1901 Paris Nigeria 02/09/09 10:00:00 AM
1922 Paris New York 02/09/09 10:00:00 AM
1002 Paris California 09/12/10 10:00:00 AM
1099 Paris China 02/09/09 10:00:00 AM
1901 Los Angeles Paris 02/12/09 09:00:00 AM

Output: dict_values([[1099, 'China', '02/09/09', '10:00:00 AM'], [1901, 'Paris', '02/12/09', '09:00:00 AM']])
but expected output: I want it to categorize everything that Associates Paris and everything that has to do with Los Angeles

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.