Python Learning Note 4

Source: Internet
Author: User

This is the module function, and some of the graphics

Install the module with the PIP Install command, if there is no need to add the scripts under the installation package to the path in the environment variable

Enter PIP install directly on the command line xx is installed online, suitable for the download package is not found

Pip install path \ module name. WHL can be installed download good

Download the URL of the package is Baidu LFD python

Only these are installed first

View installed modules with PIP list

EZ-Ghost is a drawing.

Pandas is a file operation, to open Excel, but also to install a xlrd

Pymysql is connected to MySQL

Worldcloud can draw a word cloud

Draw one of the simplest word clouds:

Import Wordcloud as WC
Import Matplotlib.pylab as PLB
Import OS
Import Jieba
From Wordcloud import Wordcloud,imagecolorgenerator

Import NumPy as NP

Fr=open (' handsome less. txt ', ' RB ')

data = Fr.read (). Decode (' Utf-8 ')
Font=r "C:\WINDOWS\Fonts\simhei.ttf"
MYWC=WC. Wordcloud (Collocations=false, Font_path=font). Generate (data)
Plb.imshow (MYWC)
Plb.show ()

Come in with a background:

From PIL import Image

im = Np.array (Image.open (cwd+ ' \\321.png '))

Imcolor = Imagecolorgenerator (IM)

Plus, this is the background.

Python Learning Note 4

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.