5

I am trying to extract data from JSON Object which is returned from the api call for api.trends() [Tweepy] but I am not able to extract the data.

Can anyone give me an example of how to extract data from JSON object. I want to extract the data in tabular form.

Thanks in advance.

1
  • As answered and accepted, it comes across that OP wanted to know how to load the data. However, there was a deleted answer from OP (it should have been extra information edited into the question) suggesting that the actual problem was with understanding how to use the parsed data - specifically, OP showed already parsed data, and an error message that would result from trying to use that data as a file or filename. Since this is not a completely useless signpost, I edited the duplicate links so that they address both problems. At this point though, the question should probably be deleted. Commented Jul 2, 2022 at 1:39

1 Answer 1

11

Once you run it though json.loads() it becomes normal Python objects. Simply index it as you would any dict or list.

>>> json.loads('{"foo": 42, "bar": "baz"}')['bar']
'baz'
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.