I have a list with a dictionary inside containing another list for the key.
I would like to have all that information put into a csv. I tried xlwt
and csv
but I am having a hard time with it.
Here is the list and the dict which is called peopleFood
{(170, '2017-05-31'): [[0, 3], [1, 2], [2, 3], [3, 1], [4, 2], [5, 1], [6, 2], [7,
3], [8, 6], [9, 8], [10, 9], [11, 10], [12, 9], [13, 9], [14, 6], [15, 8], [16,
7], [17, 3], [18, 3], [19, 3], [20, 2], [21, 1], [22, 1], [23, 1]]},
{(176, '2017-05-23'): [[14, 9], [13, 9], [17, 5], [10, 10], [20, 2], [8, 5], [16, 7], [7, 4], [6, 1], [5, 2], [11, 11], [1, 2], [15, 9], [21, 3], [4, 1], [3, 2], [22, 3], [23, 3], [12, 10], [2, 1], [18, 2], [19, 2], [9, 12], [0, 2]]},
{(152, '2017-05-31'): [[0, 3], [1, 2], [2, 3], [3, 1], [4, 2], [5, 1], [6, 2], [7, 3], [8, 6], [9, 8], [10, 9], [11, 10], [12, 9], [13, 9], [14, 6], [15, 8], [16, 7], [17, 3], [18, 3], [19, 3], [20, 2], [21, 1], [22, 1], [23, 1]]}
I wont paste the codes since Its mostly all not working. I tried checking out How do I write a Python dictionary to a csv file
in the other questions but the dict within the list messes up the codes.