0

I'm having difficulty with extracting the different levels of key value pairs. Thanks for any support.

Dictionary is as follows:

print(data)
{'plrNum': '29221', 
 'plrName': {'last': 'Simpson', 'first': 'Webb', 'middle': '', 'nickname': ''}, 
 'statValues': {'rndEvents': '8', 'statValue1': '1,660', 'statValue2': '2', 'statValue3': '6', 'statValue4': '', 'statValue5': ''}, 
 'curRank': '1', 
 'curRankTied': '', 
 'prevRank': '1', 
 'prevRankTied': ''}

Desired output into dataframe:

 'plrNum', '29221'
 'last', 'Simpson'
 'first', 'Webb'
 'rndEvents', '8'
 'statValue1', '1,660'
 ...
 'curRank', '1'

Currently, I can pull the highest level with the below:

 df = pd.DataFrame.from_dict(data,orient='Index')
 df

 plrNum                                                    29221
 plrName       {'last': 'Simpson', 'first': 'Webb', 'middle':...
 statValues    {'rndEvents': '8', 'statValue1': '1,660', 'sta...
 curRank                                                       1
 curRankTied                                                    
 prevRank                                                      1
 prevRankTied                                                   

0 Answers0