I was hoping that there might be someway to use a comprehension to do this, but say I have data that looks like this:
data = [['a', 'b', 'c'], [1, 2, 3], [4, 5, 6]]
My ultimate goal is to create a dictionary where the first nested list holds the keys and the remaining lists hold the values:
{'a': [1, 4], 'b': [2, 5], 'c': [3, 6]}
I have tried something like this that gets me close, but as you can tell I am having trouble appending the list in the dictionary values and this code is just overwriting:
d = {data[0][c]: [] + [col] for r, row in enumerate(data) for c, col in enumerate(row)}
>>> d
{'c': [6], 'a': [4], 'b': [5]}