filereader

how to read json object in python

how to read json object in python Question: I have json file named "panamaleaks50k.json". I want to get [‘text’] field from the json file but it shows me following error the JSON object must be str, bytes or bytearray, not ‘TextIOWrapper’ this is my code with open(‘C:/Users/bilal butt/Desktop/PanamalEakJson.json’,’r’) as lst: b = json.loads(lst) print(b[‘text’]) my …

Total answers: 2

Fastest way to process a large file?

Fastest way to process a large file? Question: I have multiple 3 GB tab delimited files. There are 20 million rows in each file. All the rows have to be independently processed, no relation between any two rows. My question is, what will be faster? Reading line-by-line? with open() as infile: for line in infile: …

Total answers: 2