Skip to content
Advertisement

Add a object one level higher in pandas json

I’m new to json and pandas and want to output my data in the following schema, but I’m not sure how to add the leading ‘results’.

My dataframe:

JavaScript

My code:

JavaScript

My Json output:

JavaScript

My Json schema that I want:

JavaScript

Advertisement

Answer

Try this:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement