代码拉取完成,页面将自动刷新
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML"></script>
<!-- MathJax configuration -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true,
processEnvironments: true
},
// Center justify equations in code and markdown cells. Elsewhere
// we use CSS to left justify single line equations in code cells.
displayAlign: 'center',
"HTML-CSS": {
styles: {'.MathJax_Display': {"margin": 0}},
linebreaks: { automatic: true }
}
});
</script>
<!-- End of mathjax configuration --></head>
import pandas as pd
df = pd.read_csv("population.csv",encoding="gbk")
df
print(list(df.地区))
print(list(df.year_end_resident_population))
人口 = zip(list(df.地区),list(df.year_end_resident_population))
print(人口)
人口=list(zip(list(df.地区),list(df.year_end_resident_population.fillna(0))))
print(人口)
df.year_end_resident_population.describe()
from pyecharts import options as opts
from pyecharts.charts import Geo
from pyecharts.globals import ChartType, SymbolType
def geo_总人口() -> Geo:
c = (
Geo()
.add_schema(maptype="china")
.add("年末常住人口(万人)",人口)
.set_series_opts(label_opts=opts.LabelOpts(is_show=False))
.set_global_opts(
visualmap_opts=opts.VisualMapOpts(min_= 337.000000, max_=11169.000000),
title_opts=opts.TitleOpts(title="2017年中国分省常住人口数据"),
<span class="p">)</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">c</span>
地理图 = geo_总人口()
地理图.render_notebook()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。