1.通过json读取文件
现在,我们将探索将JSON数据转换为表格格式。 在nobel-laureates.json中,我们拥有900多位诺贝尔奖获得者的数据。 让我们加载它,看看:
nobel_laureates = json.load(open("data/nobel-laureates.json", "r"))
pprint(nobel_laureates["laureates"][:2])
输出如下:
[{
'born': '1845-03-27',
'bornCity': 'Lennep (now Remscheid)',
'bornCountry': 'Prussia (now Germany)',
'bornCountryCode': 'DE',
'died': '1923-02-10',
'diedCity': 'Munich',
'diedCountry': 'Germany',
'diedCountryCode': 'DE',
'firstname': 'Wilhelm Conrad',
'gender': 'male',
'id': '1',
'prizes': [{
'affiliations': [{
'city': 'Munich',