#!/usr/bin/env python# coding=utf-8from pyecharts import WordCloudname = ["Sam S Club","Macys","Amy Schumer","Jurassic World","Charter Communications","Chick Fil A","Planet Fitness","Pitch Perfect","Express","Home","Johnny Depp","Lena Dunham","Lewis Hamilton","KXAN","Mary Ellen Mark","Farrah Abraham","Rita Ora","Serena Williams","NCAA baseball tournament","Point Break",]value = [10000,6181,4386,4055,2467,2244,1898,1484,1112,965,847,582,555,550,462,366,360,282,273,265,]def test_wordcloud_default():wordcloud = WordCloud(width=1300, height=620)wordcloud.add("", name, value, word_size_range=[30, 100], rotate_step=66)assert "diamond" not in wordcloud._repr_html_()def test_wordcloud_shape_diamond():wordcloud = WordCloud(width=1300, height=620)wordcloud.add("", name, value, word_size_range=[30, 100], shape="diamond")assert "diamond" in wordcloud._repr_html_()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。