Code Monkey home page Code Monkey logo

wordcloud's Introduction

python真的超级超级好玩呐,不管是爬虫还是数据挖掘,真的都超级有意思。

今天,来说一说python一个好玩的模块wordcloud

构建词云的方法很多, 但是个人觉得python的wordcloud包功能最为强大,可以自定义图片.

官网: https://amueller.github.io/word_cloud/

github: https://github.com/amueller/word_cloud

例子:

闲着无聊,用wordcloud做了个词云标签,Jieba分词分析了一下给木木写的日记,捂脸ing⊂(˃̶͈̀ε ˂̶͈́ ⊂ )⋯⋯ image

又顺便从网上爬了几百句英文情诗,差不多都是这些套路

又是一项撩妹新技能get,可惜我木有妹子可以撩~~郁闷o( ̄ヘ ̄o❀) image

字体用的是cabin-sketch.bold

大家也可以自己来调模板和字体

安装

方法1

pip install wordcloud

方法2

  • github下载并解压
wget  https://github.com/amueller/word_cloud/archive/master.zip
unzip master.zip
rm master.zip
cd word_cloud-master
  • 安装依赖包

sudo pip install -r requirements.txt

  • 安装wordcloud

python setup.py install

方法三

  • 下载.whl文件

  • 使用cd命令进入whl文件的路径

  • 运行这条命令:

python -m pip install <filename>

源码在word.py中

源码的运行结果就像下面这个样子

Reference:

python好玩的词云wordcloud

wordcloud's People

Contributors

fyuanfen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.