Skip to content

Tag: nested

json list to nested based on id

How would I group JSON objects by id’s to make a nested JSON in Python? The JSON is structured this way: The goal is to have a tree structure where each object(section) contains all its subsections going from 4 to 4.1 > 4.1.1 > 4.1.1.1. The snippet of the required output is below: Answer You can u…

How to extract json from nested column to dataframe

I’m pulling stock data from TD Ameritrade API and I want to store it in a DataFrame. From the API I get a nested JSON object and when I put it in a data frame I get 4 columns: Index, Candles, Empty, Symbol. However inside of candles is a dictionary that I want as separate columns in the dataframe (&#821…