1

I am currently working with Twitter stream data and I want to convert the nested JSON response to ndjson using python. I saw a few examples using json.normalize but that just seperated it to one level and my output has much deeper levels. I am new to JSON and tried searching for any examples but did not find any. Here's how my streaming output looks like: Streamed twitter response

I want to flatten out the JSON to ndjson so that I can isolate the columns I want to filter for my analysis.

Thanks, Hrishikesh

1 Answers1

-1

pandas.json_normalize can help here. With pandas you can flatten json having multiple nested levels. Check out the following link on how to use the method:

https://pandas.pydata.org/pandas-docs/version/1.2.0/reference/api/pandas.json_normalize.html

dsillman2000
  • 976
  • 1
  • 8
  • 20