赞
踩
- # -*- coding: utf-8 -*-
- """
- Created on Thu Sep 27 10:06:17 2018
- @author: JUSTi
- """
-
- import urllib3
- from pyecharts import Geo
- import pandas as pd
-
- urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
-
- def scratch(url):
- http = urllib3.PoolManager()
- response = http.request('GET',url)
- data = response.data.decode('UTF-8')
- return data
-
- def depict(url):
- tables = pd.read_html(url)
- df = pd.DataFrame(tables[0])
- city = []
- degree = []
- df.to_html("table")
- for i in range(1,df.shape[0]):
- ct = df[5][i]#城市
- deg = df[0][i]
- dep = df[4][i]
- d = []
- d.append(deg)
- d.append(dep)#震级和深度
- city.append(ct)
- degree.append(d)
-
- geo = Geo("地震图", "数据来源:中国地震台网", title_color="#fff",title_pos="center"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。