I was provided with a JSON file which looks something like below when opened with Atom:
["[{\"column1\":value1,\"column2\":value2,\"column3\":value3 ...
I tried loading it in Jupyter with pandas read_json as such:
data = pd.read_json('filename.json', orient = 'records')
And when I print data.head(), it shows the result below:
screenshot of results
I have also tried the following:
import json
with open('filename.json', 'r') as file:
data = json.load(file)
When I check with type(data) I see that it is a list. When I check with data[0][1], it returns me { i.e. it seems that the characters in the file has been loaded as a single element in the list?
Just wondering if I am missing anything? I am expecting the JSON file to be loaded as a dataframe so that I can analyze the data inside. Appreciate any guidance and advice. Thanks in advance!