Echarts 是個由百度開源的數據可視化,憑藉着良好的交互性,精巧的圖表設計,獲得了衆多開發者的承認。而 Python 是門富有表達力的語言,很適合用於數據處理。當數據分析趕上數據可視化時pyecharts 誕生了。json
import json import os from pyecharts import options as opts from pyecharts.charts import Page , Sankey
#例如 sankey_base().render_notebook() #//三等級圖
from pyecharts.charts import Bar bar=( Bar () . add_xaxis(["襯衫", "羊毛衫",「雪紡衫",""褲子","高跟鞋",「襪子"]) . add_yaxis("商家A",[5, 20, 36, 10, 75, 90]) #還能夠 .add_yaxis('商家B',[1,2,3,4])等 ) bar. render_ notebook ()
from pyecharts import options as opts from pyecharts.charts import Page, WordCloud from pyecharts.globals import SymbolType words = [ ("San S Club",10000), ("Macys",6181), ("Amy Schumer",4386), ("Juassic World",4055), ("Charter Communications",2467), ("Chick Fil A",2244), ("Planet Fitness",1868), ("Pitch Perfect", 1484), ("Express",1112), ("Home",865), ("Johmny Depp",847), ("Lena Dunham",582), ("Levis Hamilton",555), ("KKAN",550), ("Mary Ellen Mark",462), ("Farrah Abraham",366), ("Rita Ora",360), ("Serena Williams",282), ("NCAA baseball tournament",273), ("Point Break",265), ] def wordcloud_base(): c = ( WordCloud() .add("",words,word_size_range=[20,100],shape=SymbolType.RECT) .set_global_opts(title_opts=opts.TitleOpts(title="WordCloud基本示例")) ) return c wordcloud_base().render_notebook()