I am trying to parse this JSON using pandas and getting this particular error:
import pandas as pd
import json
from pandas.io.json import json_normalize
from IPython.display import HTML
from IPython.core.display import HTML
data = [{
"Name": {
"Name": "abc xyz",
"email": "[email protected]",
"website": "www.abc.me",
"github": "https://github.com/abc",
"address": "abc"
},
"Test":
"Name": "abc xyz",
"email": "[email protected]",
"website": "www.abc.me",
"github": "https://github.com/abc",
"address": "abc"
}
}]
Name = pd.io.json.json_normalize(data['Name'])
Name.set_index('Name', inplace=True)
Name
I get this error TypeError: list indices must be integers or slices, not str
But if try the same of just one element from the JSON it does work.
datais a list...data['Name']is not syntactically correct.