91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 35KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2024-02-05
  • 語言: Python
  • 標(biāo)簽: python??

資源簡介

python分析國家統(tǒng)計(jì)局?jǐn)?shù)據(jù)網(wǎng)站本情況代碼和數(shù)據(jù)集

資源截圖

代碼片段和文件信息

“““
需要分析的點(diǎn)
1、總?cè)丝?br/>2、男女人口比例
3、人口城鎮(zhèn)化
4、人口增長率
5、人口老化(撫養(yǎng)比)

獲取詳細(xì)教程、獲取代碼幫助、提出意見建議
關(guān)注微信公眾號(hào)「裸睡的豬」與豬哥聯(lián)系

@Author??:???豬哥

“““
import?numpy?as?np
import?pandas?as?pd
import?pyecharts.options?as?opts
from?pyecharts.charts?import?Line?Bar?Page?Pie
from?pyecharts.commons.utils?import?JsCode

#?人口數(shù)量excel文件保存路徑
POPULATION_EXCEL_PATH?=?‘population.xlsx‘

#?讀取標(biāo)準(zhǔn)數(shù)據(jù)
DF_STANDARD?=?pd.read_excel(POPULATION_EXCEL_PATH)
#?自定義pyecharts圖形背景顏色js
background_color_js?=?(
????“new?echarts.graphic.LinearGradient(0?0?0?1?“
????“[{offset:?0?color:?‘#c86589‘}?{offset:?1?color:?‘#06a7ff‘}]?false)“

#?自定義pyecharts圖像區(qū)域顏色js
area_color_js?=?(
????“new?echarts.graphic.LinearGradient(0?0?0?1?“
????“[{offset:?0?color:?‘#eb64fb‘}?{offset:?1?color:?‘#3fbbff0d‘}]?false)“



def?analysis_total():
????“““
????分析總?cè)丝?br/>????“““
????#?1、分析總?cè)丝冢嬋丝谇€圖
????#?1.1?處理數(shù)據(jù)
????x_data?=?DF_STANDARD[‘年份‘]
????#?將人口單位轉(zhuǎn)換為億
????y_data?=?DF_STANDARD[‘年末總?cè)丝冢ㄈf人)‘].map(lambda?x:?“%.2f“?%?(x?/?10000))
????#?1.2?自定義曲線圖
????line?=?(
????????Line(init_opts=opts.InitOpts(bg_color=JsCode(background_color_js)))
????????????.add_xaxis(xaxis_data=x_data)
????????????.add_yaxis(
????????????series_name=“總?cè)丝凇?br/>????????????y_axis=y_data
????????????is_smooth=True
????????????is_symbol_show=True
????????????symbol=“circle“
????????????symbol_size=5
????????????linestyle_opts=opts.LinestyleOpts(color=“#fff“)
????????????label_opts=opts.LabelOpts(is_show=False?position=“top“?color=“white“)
????????????itemstyle_opts=opts.ItemstyleOpts(
????????????????color=“red“?border_color=“#fff“?border_width=1
????????????)
????????????tooltip_opts=opts.TooltipOpts(is_show=False)
????????????areastyle_opts=opts.AreastyleOpts(color=JsCode(area_color_js)?opacity=1)
????????????#?標(biāo)出4個(gè)關(guān)鍵點(diǎn)的數(shù)據(jù)
????????????markpoint_opts=opts.MarkPointOpts(
????????????????data=[opts.MarkPointItem(name=“新中國成立(1949年)“?coord=[0?y_data[0]]?value=y_data[0])
??????????????????????opts.MarkPointItem(name=“計(jì)劃生育(1980年)“?coord=[31?y_data[31]]?value=y_data[31])
??????????????????????opts.MarkPointItem(name=“放開二胎(2016年)“?coord=[67?y_data[67]]?value=y_data[67])
??????????????????????opts.MarkPointItem(name=“2019年“?coord=[70?y_data[70]]?value=y_data[70])
??????????????????????]
????????????)
????????????#?markline_opts?可以畫直線
????????????#?markline_opts=opts.MarkLineOpts(
????????????#?????data=[[opts.MarkLineItem(coord=[39?y_data[39]])
????????????#????????????opts.MarkLineItem(coord=[19?y_data[19]])]
????????????#???????????[opts.MarkLineItem(coord=[70?y_data[70]])
????????????#????????????opts.MarkLineItem(coord=[39?y_data[39]])]]
????????????#?????linestyle_opts=opts.LinestyleOpts(color=“red“)
????????????#?)
????????)
????????????.set_global_opts(
????????????title_opts=opts.titleOpts(
????????????????title=“新中國70年人口變化(億人)“
????????????????pos_bottom=“5%“
????????????????pos_left=“center“
????????????????title_textstyle_opts=opts.TextstyleOpts(color=“#fff“?font_size=16)
????????????)
????????????#?x軸相關(guān)的選項(xiàng)設(shè)置
?

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

????.......?????37569??2020-02-04?11:41??china_population-master\analysis_age.html

????.......?????27008??2020-02-04?11:41??china_population-master\analysis_growth.html

????.......?????12008??2020-02-04?11:41??china_population-master\population.xlsx

????.......?????20517??2020-02-04?11:41??china_population-master\population_analysis.py

????.......?????46406??2020-02-04?11:41??china_population-master\population_sex.html

????.......??????3137??2020-02-04?11:41??china_population-master\population_spider.py

????.......?????22502??2020-02-04?11:41??china_population-master\population_total.html

????.......?????36931??2020-02-04?11:41??china_population-master\population_urbanization.html

?????目錄??????????0??2020-12-18?09:56??china_population-master

-----------?---------??----------?-----??----

???????????????206078????????????????????9


評(píng)論

共有 條評(píng)論