Let’s say I have a pandas df like this: I would like to transform it in a json format like this: How can I do this? The nearest match I had was using df.to_json(orient=”index”) but what I’ve got was a structure like this: Would be really thankful for any help! Answer Use df.to_dict(‘records’)