I'm trying to do a pd.json_normalized on a dataframe but it results into an empty dataframe.
initial dataframe (https://i.sstatic.net/jGphv.png)
after applying json_normalized,
df1 = pd.json_normalize(df)
print(df1)
it became an empty dataframe. (https://i.sstatic.net/733Dx.png)
when I tried to define the dataframe manually using below, I got my expected output
data = [
{'birthday': '542217600000', 'first_name': 'Char', 'gender': 'Male', 'last_name': 'Mander', 'nick_name': ''},
{'birthday': '967046400000', 'first_name': 'ABC', 'gender': 'Male', 'last_name': 'ZXY', 'nick_name': ''},
{'birthday': '739900800000', 'first_name': 'Test', 'gender': 'Male', 'last_name': 'tickles', 'nick_name': ''}
]
birthday = pd.json_normalize(data, max_level=1)
print(birthday)
(https://i.sstatic.net/IB2th.png)
May I know how can I directly normalized from a dataframe?