运行疫情数据时报错下面的提示要如何修改
下面是我的源代码
import requests # 发送网络请求模块
import json
import pprint # 格式化输出模块
import pandas as pd # 数据分析当中一个非常重要的模块
url = 'https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5&_=1638361138568%27
response = requests.get(url, verify=False)
json_data = response.json()['data']
json_data = json.loads(json_data)
china_data = json_data['areaTree'][0]['children'] # 列表
data_set = []
for i in china_data:
data_dict = {}
# 地区名称
data_dict['province'] = i['name']
# 新增确认
data_dict['nowConfirm'] = i['total']['nowConfirm']
# 死亡人数
data_dict['dead'] = i['total']['dead']
# 治愈人数
data_dict['heal'] = i['total']['heal']
# 死亡率
data_dict['deadRate'] = i['total']['deadRate']
# 治愈率
data_dict['healRate'] = i['total']['healRate']
data_set.append(data_dict)
df = pd.DataFrame(data_set)
df.to_csv('tengxundata.csv')