0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

pythonのwordcloudを簡単に使ってみよう!

Posted at

pythonのWordCloudライブラリとは

文章中で出現頻度が高い単語を頻度に応じた大きさで図示してくれるやつ!

wordcloud公式ドキュメント

公式ギャラリー

早速簡単に使ってみよう

環境

$ python3 -V
Python 3.7.3

仮想環境構築

$ mkdir wordcloud-sample    
$ cd wordcloud-sample 
$ python3 -m venv venv
$ source ./venv/bin/activate

wordcloudインストール

$ pip install wordcloud

wordcloudを実行

$ python3
Python 3.7.3 (default, Mar  6 2020, 22:34:30) 
[Clang 11.0.3 (clang-1103.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from wordcloud import WordCloud
>>> WordCloud().generate("hello world").to_image().show()

実行結果

helloworld.png


よかったよかった

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?