Skip to content

Tag: json

Convert nested list to JSON using Python

I’m using the following SQL query to get data for every month in a given year: When I’m returning this via Python, I’m getting the following result: Also, there are n everywhere in the result. I need the result in JSON format, but I can’t get it right. How can I do it? Answer If l is t…

trying to get specific data from API response

Trying to get “equity” data from a API response for calculate but can’t get through. This is my code: Keep getting TypeError: And this is data I am trying to tear apart: Answer Done with this type, go through json.dumps and json.loads and track the data in equity to get number in json

python – json , how to make a json flat

so i have a nested json that contains two groups , each group has a field that contains more sub groups i would like to pop all the sub groups out to flatten the json and remove the sub groups field What is the correct way to do it JSON : This is the expected result: I need to pop

Extract specific value from JSON with Python

I am trying to get all the websites from this json file Unfortunately, when I use this code: I get following error: Any help is appreciated. Thank you in advance Answer Use raw data to get raw json and then iterate over ‘tokens’ attr of the response object:

Return JSON object with a “header”

I have an API, where I need to return data. I want to make a “header”, where I specify the amount of tutors, the call returned. My current function looks like this: This is an example, of the response. ] I’d like to add a header, that specifies the amount of tutors/arrays that the response r…