I would like to know how to create an Excel file with the data inside a list that has dictionaries nested in Python.
The structure of the data is as follows:
xs=[{'x': 2, 'y': 1, 'z': 4}, {'x': 3, 'y': 15, 'z': 41}, {'x': 22, 'y': 10, 'z': 40}, {'x': 132, 'y': 89, 'z': 01}]
I'm using the xlsxwriter library but I have a question about how to iterate to get each dictionary to be a row, with each key being a column.
That is, the previous list should give rise to the following table:
┌─────┬────┬────┐ │ 2 | 1 │ 4 │ ├─────┼────┼────┤ │ 3 │ 15 │ 41 │ ├─────┼────┼────│ │ 22 │ 10 │ 40 │ ├─────┼────┼────┤ │ 132 │ 89 │ 1 │ └─────┴────┴────┘