Skip to content
Advertisement

Tag: json

python read a specific json

I’m trying to read this json. I need values: PoolID, PoolSystemCapacityGb2,NumPagesUsedPool, and others.. But i can only read values for the ‘PooID’:1, not for the PooID’:90 How can i parse this kind of json? My code: thanks for help. Answer If you need to get all objects from JSON with some specific key, you will need to traverse all elements.

Read JSON Lines file as String in Python

I have a JSON Lines file that I would like to read as a string in Python. The file contains multiple JSON objects in this format: I tried the following code in Python but it returned an error. I was able to load the file as a list of dictionaries using lines = [] but apprently it doesn’t work for

Cannot add/append element to JSON File

So, I was making a discord bot for an RP server with 4k members in emergency. My goal was to store the lawyers database in a json file that would be hosted on one of my computers for testing. Here is my code: Here is the Compiler Error (Python 3.9): I tried to look at other posts to see if

Python pandas extract data from nested list

For a personal project, I’m calling data from the Google Books API and uploading the fields I want to mySQL. I’ve successfully made the API request and received data. The data received is nested and i want to place this in a dataframe. Now my code works with the “first” column (no indent). All data after, I cannot enter this

Advertisement