|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
"""
|
|
|
|
|
Created on Tue Dec 12 15:24:14 2023
|
|
|
|
|
|
|
|
|
|
@author: Toon
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
@ -25,6 +24,7 @@ html = response.text
|
|
|
|
|
parse = etree.HTMLParser(encoding='utf-8') # 添加编码
|
|
|
|
|
# 解析 requests 返回的响应结果
|
|
|
|
|
doc = etree.HTML(html)
|
|
|
|
|
# 地区名称
|
|
|
|
|
state = doc.xpath('//html/body/div/div/div[2]/div[2]/div/div/div/div//tbody/tr/td/span/text()')
|
|
|
|
|
# 确诊人数
|
|
|
|
|
person = doc.xpath('//html/body/div/div/div[2]/div[2]/div/div/div/div//tbody/tr/td[2]/text()')
|
|
|
|
@ -43,8 +43,6 @@ df.head()
|
|
|
|
|
df.info()
|
|
|
|
|
df1 = df.head(15)
|
|
|
|
|
df1 = df1[::-1]
|
|
|
|
|
# 在jupyter中直接展示图像
|
|
|
|
|
#%matplotlib inline
|
|
|
|
|
# 设置中文显示
|
|
|
|
|
plt.rcParams['font.sans-serif'] = ['SimHei']
|
|
|
|
|
plt.rcParams['figure.figsize'] = (5,5) # 设置figure_size尺寸
|
|
|
|
|