Skip to content
Advertisement

Parsing nested JSON with list comprehension in Python

My data is as following (this just extract but there are much more objects, some don’t have the additionalData)

JavaScript

I’m trying to iterate with list comprehension to get dataframe of referenceDataItems and everything within that key, also additionalData if appears.

JavaScript

Expected result:

JavaScript

Advertisement

Answer

I did some research and this almost got my desired data, needs little modification in COLUMNS_TO_DROP

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