Read JSON file correctly

Peter Otten __peter__ at
Sat Apr 1 08:43:05 EDT 2017

Umar Yusuf wrote:

> How do I read this json file correctly? Details at:

Should you ever come back please take the time to post the "details" here. 
Also, provide the traceback as text rather than an image. 
Thank you.

As the answer on stackoverflow says, the file is opened using the cp1252 
encoding when it should be utf-8.

While I don't know how to make that the default on Windows here's a 

import pandas

with open("input.json", encoding="utf-8") as infile:
    df = pandas.read_json(infile)

More information about the Python-list mailing list