I scraped an election site for the state of Pennsylvania in the United States and here's a sample of the resulting nested dictionary from the site's json:
some_dict = {'Election': {'Statewide': [{'ADAMS': [{'CandidateName': 'BIDEN, JOSEPH '
'ROBINETTE JR',
'CountyName': 'ADAMS',
'ElectionDayNoVotes': '0',
'ElectionDayVotes': '1',
'ElectionDayYesVotes': '0',
'ElectionYear': '2020'
},
{'CandidateName': 'TRUMP, DONALD J. ',
'CountyName': 'ADAMS',
'ElectionDayNoVotes': '0',
'ElectionDayVotes': '1',
'ElectionDayYesVotes': '0',
'ElectionYear': '2020'
}],
'ALLEGHENY': [{'CandidateName': 'BIDEN, JOSEPH '
'ROBINETTE JR',
'CountyName': 'ALLEGHENY',
'ElectionDayNoVotes': '0',
'ElectionDayVotes': '1',
'ElectionDayYesVotes': '0',
'ElectionYear': '2020'
},
{'CandidateName': 'TRUMP, DONALD '
'J. ',
'CountyName': 'ALLEGHENY',
'ElectionDayNoVotes': '0',
'ElectionDayVotes': '1',
'ElectionDayYesVotes': '0',
'ElectionYear': '2020'
}]}]}}
I can't figure out how to turn it into a dataframe that would look like this:
