How to add rows from python dict based on colum names

101 views
Skip to first unread message

Sido Brak

unread,
Dec 23, 2023, 11:39:27 AM12/23/23
to openpyxl-users
I have excel with columns:
name | col1 | col2 | col3 | col4 | col5

And I have dict:
[
{
"name": "Bob",
"col1": "P",
"col3": "X"
},
{
"name": "Alice",
"col2": "P",
"col4": "P"
}
]

How to add rows to excel to columns based on column names from dict?
It would be great if we could add cell values based on dictionary names.
Reply all
Reply to author
Forward
0 new messages