let's say i have a dictionary as
dj= {
"totalrecords": 2,
"data": [
{
"stateCd": "U.K",
"stateName": "uttarakhand",
"details": {
"id": [
"2312-k",
"2312-k"
],
"date": [
"10-OCT-2019",
"11-OCT-2019"
],
"icp": [
2233,
6443
],
"icpr": [
3.434,
23.232
]
}
},
{
"stateCd": "U.P",
"stateName": "uttar pradesh",
"details": {
"id": [
"2712-k",
"5412-k"
],
"date": [
"10-OCT-2019",
"11-OCT-2019"
],
"icp": [
2233,
6443
],
"icpr": [
32.434,
31.232
]
}
}
]
}
}
I want to convert this json/dictionary into data frame which would be like this using python:
but I am having no clue how to perform this action
i have also tried pandas.json_normalize()
but didn't get my expected column in output i.e. date,icp,icpr
data_trunc=dj['data']
pd.json_normalize(data_trunc,record_path=['details','id'],meta=['stateCd','stateName'])

pandasas one of your tags, can you show us what you have tried? If you have no idea how to start, perhaps you can look at a tutorial first for converting dict to dataframe, e.g. datatofish.com/dictionary-to-dataframe