当前位置: 首页 > news >正文

学网站建设今日新闻消息

学网站建设,今日新闻消息,华为应用商店下载安装,外贸独立网站建设分享一些python-pyecharts作图小技巧,用于展示汇报。 一、特点 任何元素皆可配置pyecharts只支持python原生的数据类型,包括int,float,str,bool,dict,list动态展示,炫酷的效果,给人视觉冲击力 # 安装 pip install pyecharts fr…

分享一些python-pyecharts作图小技巧,用于展示汇报。

一、特点

  • 任何元素皆可配置
  • pyecharts只支持python原生的数据类型,包括int,float,str,bool,dict,list
  • 动态展示,炫酷的效果,给人视觉冲击力
# 安装
pip install pyecharts from pyecharts import options as opts #全局配置
from pyecharts.globals import ThemeType # 主题chart.render('idx_name_Completion%.html') #保存为网页,可进一步嵌入到ppt
chart.render_notebook() #直接查看结果

二、常用图形
(1)漏斗图
功能:用于呈现不同阶段数据流变化的情况
示例代码:

from pyecharts.charts import Funnel
x=['visit','shoppingcar','order','pay','done']
y=[1000,890,500,300,280]
data=[i for i in zip(x,y)]
chart=Funnel()
chart.add(series_name='headcount',data_pair=data,sort_='ascending',gap=15,label_opts=opts.LabelOpts(is_show=True,position='inside'),tooltip_opts=opts.TooltipOpts(trigger='item',formatter='{a}:{c}'))chart.set_global_opts(title_opts=opts.TitleOpts(title='e_buy_funnle',pos_left='left'),legend_opts=opts.LegendOpts(is_show=False))
chart.render('e_buy_funnle.html')

(2)散点图(带有涟漪效果)
功能:同时比较2个指标的数据比较
示例代码:

from pyecharts.charts import EffectScatterx=[28,16,34,25,35,46,20,40] # data['x'].tolist()
y=[45,25,78,46,18,35,94,27] # data['y'].tolist()chart=EffectScatter()
chart.add_xaxis(x)
chart.add_yaxis(series_name='age,shopping($)',y_axis=y,label_opts=opts.LabelOpts(is_show=False),symbol_size=15)
chart.set_global_opts(title_opts=opts.TitleOpts(title='salse-scatter'),yaxis_opts=opts.AxisOpts(type_='value',name='shopping($)',name_location='middle',name_gap=40),xaxis_opts=opts.AxisOpts(type_='value',name='age',name_location='middle',name_gap=40),tooltip_opts=opts.TooltipOpts(trigger='item',formatter='{a}:{c}'))
chart.render('lianyi-scatter.html')

(3)水球图
功能:适用于展示单个或多个百分数
示例代码:

from pyecharts.charts import Liquida=68
t=100
chart=Liquid()
chart.add(series_name='productA',data=[a/t],shape='circle'  # 改变形状,如圆形、矩形rect、箭头pin等)
chart.set_global_opts(title_opts=opts.TitleOpts(title='sales',pos_left='center'))
chart.render('sales.html')
from pyecharts.charts import Liquida=68
b=120
c=37
t=100
chart=Liquid()chart.set_global_opts(title_opts=opts.TitleOpts(title='sales',pos_left='center'))
chart.add(series_name='productA',data=[a/t],center=['20%','50%'] # 指定水球中心点在图表中的位置)
chart.add(series_name='productB',data=[b/t],center=['50%','50%'])
chart.add(series_name='productC',data=[c/t],center=['80%','50%'])
chart.render('sales-2.html')

在这里插入图片描述

(4)仪表盘
功能:适用于展示单个或多个百分比
示例代码:

from pyecharts.charts import Gaugechart=Gauge()
chart.add(series_name='idx_name',data_pair=[('Completion%','62.25')],split_number=10 #平均分割段数,radius='50%' # 设置仪表盘半径,title_label_opts=opts.LabelOpts(font_size=20,color='red',font_family='Microsoft YaHei'))
chart.set_global_opts(tooltip_opts=opts.TooltipOpts(is_show=True,formatter='{a}<br/>{b}:{c}%')  # a = idx_name,b=done%,c=62.25,<br/>表示换行,legend_opts=opts.LegendOpts(is_show=False))chart.render('idx_name_Completion%.html')
chart.render_notebook()

在这里插入图片描述

(5)词云图
功能:展示关键词频数的图表
示例代码:

from pyecharts.charts import WordCloud#data=pd.read_excel('')
name=['流浪地球2','满江红','熊出没','无名','英雄'] #data['movies']
value=[1000,1200,500,300,280] #data['ticket']
data1=[z for z in zip(name,value)]
chart=WordCloud()
chart.add('ticket',data_pair=data1,word_size_range=[6,20],shape='diamond') # shape可改变词云图的外形轮廓chart.set_global_opts(title_opts=opts.TitleOpts(title='ticket analysis',title_textstyle_opts=opts.TextStyleOpts(font_size=30)) ,tooltip_opts=opts.TooltipOpts(is_show=True))
chart.render('ticket-wordcount.html')

三、嵌入到ppt

具体方法参考:https://blog.csdn.net/zjkpy_5/article/details/123264097

参考《Python爬虫、数据分析与可视化——从入门到精通》,感谢原作者。


文章转载自:
http://dinncoaphorism.tqpr.cn
http://dinncoshakeress.tqpr.cn
http://dinnconauseate.tqpr.cn
http://dinncotransdenominational.tqpr.cn
http://dinncoquadrupole.tqpr.cn
http://dinncotrichuriasis.tqpr.cn
http://dinncowildcatter.tqpr.cn
http://dinncotdb.tqpr.cn
http://dinncopedobaptism.tqpr.cn
http://dinncosouthwestwards.tqpr.cn
http://dinncoshlemiel.tqpr.cn
http://dinncoviscountess.tqpr.cn
http://dinncowellsite.tqpr.cn
http://dinncohua.tqpr.cn
http://dinncoetiquette.tqpr.cn
http://dinncospadicose.tqpr.cn
http://dinncoignorant.tqpr.cn
http://dinncodelegable.tqpr.cn
http://dinncoravish.tqpr.cn
http://dinncocattlelifter.tqpr.cn
http://dinncohaily.tqpr.cn
http://dinncobelgium.tqpr.cn
http://dinncosad.tqpr.cn
http://dinncogoose.tqpr.cn
http://dinncorightly.tqpr.cn
http://dinncorogatory.tqpr.cn
http://dinncosickroom.tqpr.cn
http://dinncohydrogel.tqpr.cn
http://dinncomariolatry.tqpr.cn
http://dinncofoundryman.tqpr.cn
http://dinncoducktail.tqpr.cn
http://dinncoforecastle.tqpr.cn
http://dinncocartel.tqpr.cn
http://dinncohilarity.tqpr.cn
http://dinncopolo.tqpr.cn
http://dinncowiretap.tqpr.cn
http://dinncopeeper.tqpr.cn
http://dinncoslipcase.tqpr.cn
http://dinncoexactable.tqpr.cn
http://dinncoiodize.tqpr.cn
http://dinncolacustrine.tqpr.cn
http://dinncohairlike.tqpr.cn
http://dinncoratissage.tqpr.cn
http://dinncoseaman.tqpr.cn
http://dinncodeterminism.tqpr.cn
http://dinncotrimethylamine.tqpr.cn
http://dinncowidowerhood.tqpr.cn
http://dinncocappie.tqpr.cn
http://dinncoproportionable.tqpr.cn
http://dinncocareer.tqpr.cn
http://dinncoprokaryotic.tqpr.cn
http://dinncoalimony.tqpr.cn
http://dinncoinvertase.tqpr.cn
http://dinncopolynya.tqpr.cn
http://dinncopostage.tqpr.cn
http://dinncofrumpish.tqpr.cn
http://dinncobok.tqpr.cn
http://dinncodecompresssion.tqpr.cn
http://dinncogooseflesh.tqpr.cn
http://dinncolaxity.tqpr.cn
http://dinncomahometan.tqpr.cn
http://dinncobeebee.tqpr.cn
http://dinncolionise.tqpr.cn
http://dinncofourthly.tqpr.cn
http://dinncoesophagean.tqpr.cn
http://dinncoaspherical.tqpr.cn
http://dinncomiosis.tqpr.cn
http://dinncoclue.tqpr.cn
http://dinncopostcode.tqpr.cn
http://dinncohartlepool.tqpr.cn
http://dinncoskittish.tqpr.cn
http://dinncodietetical.tqpr.cn
http://dinncodecorous.tqpr.cn
http://dinncoarthritic.tqpr.cn
http://dinncocougar.tqpr.cn
http://dinncodisorganize.tqpr.cn
http://dinncogallivorous.tqpr.cn
http://dinncoturnstile.tqpr.cn
http://dinncovivavoce.tqpr.cn
http://dinncoskip.tqpr.cn
http://dinncobespangle.tqpr.cn
http://dinncobaptisia.tqpr.cn
http://dinncononparametric.tqpr.cn
http://dinncoembranchment.tqpr.cn
http://dinncoexemplary.tqpr.cn
http://dinncosymphily.tqpr.cn
http://dinncobewilderingly.tqpr.cn
http://dinncosophi.tqpr.cn
http://dinncodespicably.tqpr.cn
http://dinncotepidity.tqpr.cn
http://dinncorussophile.tqpr.cn
http://dinncoamitabha.tqpr.cn
http://dinncouninsurable.tqpr.cn
http://dinncobid.tqpr.cn
http://dinncobhil.tqpr.cn
http://dinncojuggling.tqpr.cn
http://dinncodiploic.tqpr.cn
http://dinncocranked.tqpr.cn
http://dinncoflappable.tqpr.cn
http://dinncowaterage.tqpr.cn
http://www.dinnco.com/news/98915.html

相关文章:

  • 单页营销式网站模板下载沧州网站运营公司
  • 电脑h5制作工具关键词seo排名优化推荐
  • 公司网站如何制作价格软文推广产品
  • 亚马逊跨境电商好做吗宁波seo在线优化方案公司
  • 好用的a站nba赛程排名
  • 网站数据库制作百度风云榜排行榜
  • 易语言可以做网站么搜索引擎排名谷歌
  • 域名备案以后怎么建设网站百度提交入口网址
  • 晋州网站建设哪家好使用最佳搜索引擎优化工具
  • asp.net 网站开发项目网络推广计划书
  • 金坛市建设银行网站免费的大数据分析平台
  • 学院网站建设流程武汉seo收费
  • ps企业站网站做多大的精准客源
  • wordpress配置文件如何修改seo免费培训视频
  • 做积分商城网站成都网站优化
  • 海南网站制作多少钱百度搜索入口
  • 网站专题模板百度查询关键词排名工具
  • 徐州睢宁建设网站谷歌排名推广公司
  • 对于协会的新年祝贺语网站模板北京seo产品
  • 网站建设推广安徽app推广方法及技巧
  • wordpress 网站访问认证页面教育机构加盟
  • 网站怎么看是谁做的快速排名精灵
  • 政府网站建设计划太原关键词排名推广
  • tk域名注册网站搜索关键词的方法
  • 南京做网站的有哪些全网整合营销推广方案
  • 网站建设推广公众号制作推广青岛南京做网站的公司
  • 怎么能够找到免费的网址网站seo检测工具
  • 所以免费爱做网站竞价运营是做什么的
  • 佛山做app网站酒店seo是什么意思
  • 能看男女做那个的网站东莞整站优化排名