How can I transform a pandas df to this kind of json structure? August 22, 2022 by Magenaut Let’s say I have a pandas df like this: