-1
import json
import pandas
import requests

Convert to Pandas

I know what you're going to say, this has been asked before. But ive gone through a number of posts already and they all require importing the json file into the code already. So with this code I've been trying to import the json data through a URL, so there is no need to save any files before hand.

Is it even possible? Please help.

1

1 Answer 1

1

Pandas json_normalize can do just that. Here is an example for which you will have to modify to meet your specific needs:

df = pd.json_normalize(packages_json, record_path='results')

(I omitted the output from the DF because is it unwieldy)

Sign up to request clarification or add additional context in comments.

2 Comments

wow thank you, its workin! right now not all the headers (rows and columns) are being shown, but i assume there is a way to adjust that
@Craig Play around with the meta parameter to access more fields.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.