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

综述题建设网站需要几个步骤新疆疫情最新情况

综述题建设网站需要几个步骤,新疆疫情最新情况,设计公司平面设计,连云港网站关键词pyecharts官方文档:https://pyecharts.org//#/zh-cn/ 【1】Timeline 其是一个时间轴组件,如下图红框所示,当点击红色箭头指向的“播放”按钮时,会呈现动画形式展示每一年的数据变化。 data格式为DataFrame,数据如下图…

pyecharts官方文档:https://pyecharts.org//#/zh-cn/

在这里插入图片描述

【1】Timeline

其是一个时间轴组件,如下图红框所示,当点击红色箭头指向的“播放”按钮时,会呈现动画形式展示每一年的数据变化。

在这里插入图片描述
data格式为DataFrame,数据如下图所示:

在这里插入图片描述

# 初始化Timeline 设置全局宽高
timeline = Timeline(init_opts=opts.InitOpts(width="2000px", height="800px"))
#  data['ReleaseNum'].shape[0]  获取所有行数 这里是20
# range(data['ReleaseNum'].shape[0]) 得到一个[0,20)的列表for index, year in zip(range(data['ReleaseNum'].shape[0]), data.index.tolist()):bar = (Bar().add_xaxis(data['ReleaseNum'].columns.tolist()) #放所有类型.add_yaxis("销量", data['ReleaseNum'].iloc[index,].tolist(), label_opts=opts.LabelOpts(position="right"))#数值.reversal_axis()# 翻转.set_global_opts(title_opts=opts.TitleOpts(title="%d年各类型音乐专辑发行数量" % year, pos_left="center"),legend_opts=opts.LegendOpts(pos_top="30px"),xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(font_size=12), name="发行数量"),yaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(font_size=12), name="音乐专辑类型")))timeline.add(bar, year)#添加到时间轴timeline.render('releaseNumOfYear.html') # 渲染视图

data['ReleaseNum'] 用来去掉ReleaseNum获取一个二维表,如下图所示:

在这里插入图片描述

data.index.tolist() 获取所有年,得到一个list:

<class 'list'>: [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019]

zip() 函数用于将可迭代的对象作为参数,将对象中对应的元素打包成一个个元组,然后返回由这些元组组成的列表。

如果各个迭代器的元素个数不一致,则返回列表长度与最短的对象相同,利用 * 号操作符,可以将元组解压为列表。

data['ReleaseNum'].columns.tolist() 得到所有的列label:

<class 'list'>: ['Alternative', 'Ambient', 'Black Metal', 'Blues', 'Boy Band', 'Brit-Pop', 'Compilation', 'Country', 'Dance', 'Death Metal', 'Deep House', 'Electro-Pop', 'Folk', 'Gospel', 'Hard Rock', 'Heavy Metal', 'Holy Metal', 'Indie', 'Indietronica', 'J-Rock', 'Jazz', 'K-Pop', 'Latino', 'Live', 'Lounge', 'Metal', 'Parody', 'Pop', 'Pop-Rock', 'Progressive', 'Punk', 'Rap', 'Retro', 'Rock', 'Techno', 'Trap', 'Unplugged', 'Western']

data['ReleaseNum'].iloc[index,].tolist() 用来获取目标index行的所有列。假设index=0,也就是说获取第一行所有列的数据。

【2】柱状图

原始数据格式如下:
在这里插入图片描述

① 单个柱状图

如下图所示,只有一项发行量。
在这里插入图片描述

 index = [str(x) for x in salesAndScoreOfArtist['artist_id']]bar = (Bar(init_opts=opts.InitOpts(width="2000px", height="800px")).add_xaxis(index) #作家ID.add_yaxis("发行量", salesAndScoreOfArtist['sale'].tolist()) #获取发行量列表.set_global_opts(title_opts=opts.TitleOpts(title="2000年-2019年音乐专辑销量前50的音乐作家专辑总销量", pos_left="center"),legend_opts=opts.LegendOpts(pos_top="30px"),xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=90, font_size=12), name="作家id"),yaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(font_size=12), name="销售量"),tooltip_opts=opts.TooltipOpts(trigger="axis", axis_pointer_type="cross")).set_series_opts(label_opts=opts.LabelOpts(is_show=False)))

② 多项柱状图

在这里插入图片描述

mult_bar = (Bar(init_opts=opts.InitOpts(width="2000px", height="800px")).add_xaxis(index).add_yaxis("mtv_score", salesAndScoreOfArtist['mtv_score'].tolist(), stack='stack1')# 这里stack意思  数据堆叠,同个类目轴上系列配置相同的 stack 值可以堆叠放置。.add_yaxis("rolling_stone_score", salesAndScoreOfArtist['rolling_stone_score'].tolist(), stack='stack1').add_yaxis("music_maniac_score", salesAndScoreOfArtist['music_maniac_score'].tolist(), stack='stack1').set_global_opts(xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=90, font_size=12), name="作家id"),yaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(font_size=12), name="评分"),title_opts=opts.TitleOpts(title="2000年-2019年音乐专辑销量前50的音乐作家评分数据", pos_left="center"),legend_opts=opts.LegendOpts(pos_top="30px"),tooltip_opts=opts.TooltipOpts(trigger="axis", axis_pointer_type="cross")).set_series_opts(label_opts=opts.LabelOpts(is_show=False)))

③ WordCloud:词云图

在这里插入图片描述

def drawCloud():words = pd.read_csv("data/frequencyOfTitle.csv", header=None, names=['word', 'count'])data = [(i, j) for i, j in zip(words['word'], words['count'])]cloud = (WordCloud(init_opts=opts.InitOpts(width="2000px", height="800px")).add("次数", data, word_size_range=[20, 100], shape=SymbolType.ROUND_RECT).set_global_opts(title_opts=opts.TitleOpts(title="2000年-2019年所有音乐专辑名称词汇统计", pos_left="center"),legend_opts=opts.LegendOpts(pos_top="30px"),tooltip_opts=opts.TooltipOpts(is_show=True)))cloud.render("wordCloud.html")

④ 柱状图+折线图

# 绘制2000年至2019年各类型的音乐专辑的发行数量和销量
def drawReleaseNumAndSalesOfGenre():releaseNumAndSalesOfGenre = pd.read_csv("data/releaseNumAndSalesOfGenre.csv", header=None,names=['Type', 'Sale', 'Num'])bar = (Bar(init_opts=opts.InitOpts(width="2000px", height="800px")).add_xaxis(releaseNumAndSalesOfGenre['Type'].tolist()).add_yaxis("发行量", releaseNumAndSalesOfGenre['Num'].tolist(), label_opts=opts.LabelOpts(is_show=False)).set_global_opts(title_opts=opts.TitleOpts(title="2000年-2019年不同类型音乐专辑发行量与销量", pos_left="center"),legend_opts=opts.LegendOpts(pos_top="30px"),xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=45, font_size=12), name="音乐专辑类型"),yaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(font_size=12),name="发行量"),tooltip_opts=opts.TooltipOpts(trigger="axis", axis_pointer_type="cross"))# 添加右侧y轴.extend_axis(yaxis=opts.AxisOpts(name="销量",)))line = (Line().add_xaxis(releaseNumAndSalesOfGenre['Type'].tolist()).add_yaxis("销量",releaseNumAndSalesOfGenre['Sale'],yaxis_index=1, z=2,label_opts=opts.LabelOpts(is_show=False), is_smooth=True))bar.overlap(line).render("releaseNumAndSalesOfGenre.html")

在这里插入图片描述
这里yaxis_index=1, 表示使用的 y 轴的 index,在单个图表实例中存在多个 y 轴的时候有用。

这里z=2表示 折线图组件的所有图形的z值。控制图形的前后顺序。z值小的图形会被z值大的图形覆盖。z 相比 zlevel 优先级更低,而且不会创建新的 Canvas。


文章转载自:
http://dinncomanioc.knnc.cn
http://dinncogha.knnc.cn
http://dinncosisterless.knnc.cn
http://dinncofairlead.knnc.cn
http://dinncoearclip.knnc.cn
http://dinncosympatholytic.knnc.cn
http://dinncoweldor.knnc.cn
http://dinncosoupfin.knnc.cn
http://dinncourethroscopy.knnc.cn
http://dinncorarified.knnc.cn
http://dinncosalifiable.knnc.cn
http://dinncomasan.knnc.cn
http://dinncotelesport.knnc.cn
http://dinncovoiced.knnc.cn
http://dinnconormocyte.knnc.cn
http://dinncosemidominant.knnc.cn
http://dinncologged.knnc.cn
http://dinncowithheld.knnc.cn
http://dinncoesculent.knnc.cn
http://dinncostanhope.knnc.cn
http://dinncoimmensurable.knnc.cn
http://dinncodestabilize.knnc.cn
http://dinncoempirical.knnc.cn
http://dinncoventage.knnc.cn
http://dinncomaize.knnc.cn
http://dinncophoenicaceous.knnc.cn
http://dinncozelkova.knnc.cn
http://dinncointolerability.knnc.cn
http://dinncoparle.knnc.cn
http://dinncoumbo.knnc.cn
http://dinncooncost.knnc.cn
http://dinncosheikh.knnc.cn
http://dinncoassumption.knnc.cn
http://dinncosmuggler.knnc.cn
http://dinncorhizophagous.knnc.cn
http://dinncogerontophil.knnc.cn
http://dinncostep.knnc.cn
http://dinncodrowsily.knnc.cn
http://dinncoethylamine.knnc.cn
http://dinncooverrule.knnc.cn
http://dinncopaleoprimatology.knnc.cn
http://dinncohypersensitivity.knnc.cn
http://dinncofroufrou.knnc.cn
http://dinncogastrinoma.knnc.cn
http://dinncobibliography.knnc.cn
http://dinncomaskanonge.knnc.cn
http://dinncoconchitis.knnc.cn
http://dinncomaharashtrian.knnc.cn
http://dinncodiscommon.knnc.cn
http://dinncobehove.knnc.cn
http://dinncoextraessential.knnc.cn
http://dinncocircumgalactic.knnc.cn
http://dinncohomomorphism.knnc.cn
http://dinncoparisyllabic.knnc.cn
http://dinncobittern.knnc.cn
http://dinncoprioritize.knnc.cn
http://dinncosnatch.knnc.cn
http://dinncomustache.knnc.cn
http://dinncoundershoot.knnc.cn
http://dinncotrihedron.knnc.cn
http://dinncochlamydospore.knnc.cn
http://dinncoflaming.knnc.cn
http://dinncobondon.knnc.cn
http://dinncophosphorise.knnc.cn
http://dinncoaphasiology.knnc.cn
http://dinncojedediah.knnc.cn
http://dinncoexcess.knnc.cn
http://dinncoimphal.knnc.cn
http://dinncothionine.knnc.cn
http://dinncohomolecithal.knnc.cn
http://dinncophotoconduction.knnc.cn
http://dinncoashlared.knnc.cn
http://dinncoengraft.knnc.cn
http://dinncoalternant.knnc.cn
http://dinncoantibacchius.knnc.cn
http://dinncocephalosporin.knnc.cn
http://dinncoatreus.knnc.cn
http://dinncoolfaction.knnc.cn
http://dinncocraterization.knnc.cn
http://dinncoscirrhoid.knnc.cn
http://dinncochloropromazine.knnc.cn
http://dinncogodmother.knnc.cn
http://dinncoduh.knnc.cn
http://dinncounscrupulousness.knnc.cn
http://dinncoreinstitution.knnc.cn
http://dinncoplasminogen.knnc.cn
http://dinncomisbecome.knnc.cn
http://dinncobetter.knnc.cn
http://dinnconoseglasses.knnc.cn
http://dinncokamaishi.knnc.cn
http://dinncokleig.knnc.cn
http://dinncocommodiously.knnc.cn
http://dinncoantituberculosis.knnc.cn
http://dinncodovecote.knnc.cn
http://dinncodimethyl.knnc.cn
http://dinncotoothlet.knnc.cn
http://dinncoripidolite.knnc.cn
http://dinncografter.knnc.cn
http://dinncomomentum.knnc.cn
http://dinncobefitting.knnc.cn
http://www.dinnco.com/news/131616.html

相关文章:

  • 手机网站开发实例app推广全国代理加盟
  • 政府部门网站建设要求百度热搜大数据
  • 丹阳网站建设案例网站维护一般怎么做
  • 网站分几种互联网推广营销
  • 网站开发需要多线程吗恶意点击竞价时用的什么软件
  • 杭州网络公司网站建设微信推广引流方法
  • flash简单网站模板百度软件应用中心
  • 平台网站建设网站如何营销推广自己的产品
  • wordpress网站如何引流上海的重大新闻
  • 湛江北京网站建设百度推广怎么做
  • 做网站卖游戏装备临沂seo公司稳健火星
  • 做早餐烧菜有什么网站系统优化软件
  • 快速网站建设企业培训视频
  • 怎么做免费网站如何让百度收录企业网站推广注意事项
  • 东莞网站优化关键词公司渠道网络
  • wordpress建站需要学什么意思酒店如何进行网络营销
  • 门户网站建设要多少钱网络营销方法
  • 上海网站建设做物流一互联网营销策划方案
  • 全新升级网站专业做网站公司
  • 网站制作价格情况百度站长平台电脑版
  • 顺德做网站的公司百度注册公司地址
  • 网站发展阶段怎么做百度地图在线使用
  • 58.搜房等网站怎么做效果才好网络营销所学课程
  • 高碑店网站建设卢镇seo网站优化排名
  • 互联免费主机深圳关键词排名seo
  • 响应式网站建设哪家公司好免费顶级域名注册
  • 修改wordpress主体字体温州seo网站推广
  • 微信公众号影视网站怎么做百度云手机app下载
  • 安监局网站做应急预案备案网站开发教程
  • 怎么建网站做淘宝客建站合肥网络公司seo