Python: how to export a dictionary of nested lists to Excel

Viewed 1775

I'm new to Python and I'm having trouble to resolve this issue.

For instance if I have a dictionary like this one:

my_dict = {(40987, 'A'): [[1, 2, 3], [0, 1, 0], [0, 1, 1]], (11233, 'R'): [[2, 0, 2], [0, 2, 4]], (10716, 'R'): [[1, 1, 1]], (11049, 'S'): [[6, 0, 5], [2, 5, 7]]}

The structure of the excel file that I want is:

Code  Letter    List0        List1      ...     List_n

40987   A     [1, 2, 3]    [0, 1, 0]
11233   R     [2, 0, 2]    [0, 2, 4]
.... 

Is there a way to export this dictionary of nested lists to an excel file?

3 Answers
Related