Is there a way to create a dictionary with a nested list but for specific indices?
I have input:
data = [[int, int, int], [int, int, int], [int, int,int]]
I want to so something along the lines of:
my_dictionary = {}
for x in data:
my_dictionary[x[0]] = []
my_dictionary[x[1]] = []
but without having to iterate through the whole thing.
For example:
data = [[a,b,c], [d,e,f], [g,h,i]]
# would leave me with:
my_dictionary = {a: [] , b:[], d:[], e:[], g:[], h:[] }
Is there a way to specify this using dictionary comprehension?