with open(filename+'.json') as json_file:
data=pd.io.json.read_json(json_file,encoding='utf_16_be')
I tried multiple options for encoding but it fails. It returns empty object. I can convert only when save my file in Notepad++ as UTF8 without BOM. I open it as normally with default encoding:
with open(filename+'.json') as json_file:
data=pd.io.json.read_json(json_file)
Default encoding of the file is UTC-2 Little Endian. How to read json with this encoding?
Read and follow
import pandas as pd; help (pd.io.json.read_json). The following (partially commented) code snippet could help:Output:
.\SO\69537408.py