Introduction to Python data visualization
As a data analyst, it is necessary to master visualization skills. In most cases, the superior is more concerned with the results presented. When the visual results are presented in front of your eyes, you can intuitively experience the “beauty of data”. In content expression, pictures are much better than words. They can not only reflect the authenticity of data, but also give people a lot of imagination.
We often hear that tableau and powerbi are business visualization tools. They are powerful in visual flexible analysis, and their main target users are professional data analysts. At the same time, the usage rate is high in the work scene, so mastering is very helpful for promotion and job hunting. After that, datascience will also launch relevant training.
Python is the preferred language for data analysis. If our learning goal is data mining engineer or algorithm engineer, the most important thing is to understand and master Python data visualization. Students and researchers can also use Python for visualization. In addition, when we use Python to interact with the database, it is more convenient to analyze and observe the data directly in Python.
Python includes many visualization libraries, such as Matplotlib, Seaborn, bokeh, plot, pyechards, mapbox, and geoplotlib. Among them, Matplotlib and Seaborn are the most important ones to master. Matplotlib is the visual basic library of Python. Its drawing style is similar to Matlab, so it is called Matplotlib. If you want to learn Python data visualization, you will learn from Matplotlib, and then learn other Python visualization libraries.
Seaborn is a ⾼ level visualization Library Based on Matplotlib, which makes the drawing easier
The content of this course includes Python installation, language basis, drawing basis, and using Matplotlib and Seaborn library to draw ten common visualization attempts, such as: line chart, histogram, box line diagram, etc., and master the application scenarios of the attempt in different situations.
Installation and environment construction
There are two main versions of Python: 2.7. X and 3. X. Some old projects use packages based on version 2.7. If so, only 2.7 can be used. At present, we only need to use the new version 3. X. For basic students, it is recommended to use Anaconda to install Python environment.
Download address: https://www.anaconda.com/prod…
After opening the page, click download. According to the operating system, choose to download the version of Python 3.7, which is divided into 64 bit version and 32-bit version. After viewing the operating system, you can see that 64 bit or 32-bit version is downloaded. If the computer equipment is not very old, the 64 bit version is usually downloaded.
Open the downloaded installation package and click the next page: “I agree”—
Next: install for: just me if there is only one user all user if there are multiple users on the computer, I will select all user here and continue to click “next”
Next: select the target folder: if Disk C has enough space, you can select the default address; click “next”
Next: advanced options: the first is to add environment variables, the second is to use Python 2.7 by default; check both, and click “next”
After waiting for the installation to complete, click “fish” to complete the installation
Start Jupiter notebook
Jupyter notebook is an open source web application that allows users to create and share documents containing code, equations, visualization, and text. Using Jupiter notebook allows us to edit, run and debug code in the web page, which is very convenient to use.
After aanconda is installed, find the menu directory and find theAnaconda NavigtorIcon, double-click to open, and the following interface appears:
Select Jupiter notebook and click launch. Start jupyter notebook, and the web browser will open the file and file interface.
We can create a file on the desktop named “data visualization” to save the code file.
In jupyter notebook, select the path: desktop / data visualization /, and click New in the upper right corner to create a python 3 file
After the file is built, we edit the code in the text box and click the “run” button to debug and output the results.
For more information on how to use Jupiter notebook, you can search relevant documents online for learning.
Welcome to Xiaobian blog: www.a2data.cn
Building SQL community www.sqlsq.cn