Hello I have a CSV file of the format below:
ticket asset
1111 3456
1111 6789
1122 2345
1122 7890
I want to convert it to a Dict like:
{'1111': ['3456', '6789'], '1122':['2345', '7890']}
Basically want to have the ticket as 'key' and all the assets under that ticket as 'values'.
the csv.DictReader() helped a little but I am unable to extract unique ticket number for keys and match all the asset under it for values.
Any help would be great :)
Thanks for getting the CSV > Dict so quick!
If I want to convert a Tuple to Dict, how will that work?
e.g: Tuple: ((1111, 3456), (1111, 6789), (1122, 2345), (1122, 7890))
and I want that to be converted to:
{'1111': ['3456', '6789'], '1122':['2345', '7890']}