In [1]:
import pandas as pd
In [2]:
data = [{'name': 'vikash', 'age': 27}, {'name': 'Satyam', 'age': 14}]
In [3]:
df = pd.DataFrame.from_dict(data, orient='columns')
In [4]:
df
Out[4]:
In [5]:
from pandas.io.json import json_normalize
In [6]:
data = [
{
'name': {
'first': 'vikash',
'last': 'singh'
},
'age': 27
},
{
'name': {
'first': 'satyam',
'last': 'singh'
},
'age': 14
}
]
In [7]:
df = pd.DataFrame.from_dict(json_normalize(data), orient='columns')
In [8]:
df
Out[8]:
In [ ]: