当前位置:网站首页>Data analysis notes 09
Data analysis notes 09
2022-07-04 06:29:00 【weixin_ forty-five million six hundred and ninety-six thousand 】
Visual chart There is a trend Distribution constitute Compare and practice
matplotlib
Trends show how data changes over time
Through a line chart Or histogram
Distribution Distribution law of data Use a scatter chart to show different distribution characteristics
constitute Used to represent The proportion of each part of the data in the total If Want to show the proportion of a period of time , It is more suitable to display with percentage stacked histogram
Compare Used for data comparison in a certain dimension The relationship between comparative data is usually reflected by cluster histogram and parallel subgraph
contact Measure the relationship between two dimensional data double y Axis overlay
matplotlib The composition of the image Install and import matplotlib modular Set up matplotlib typeface
Elements canvas (Figure) Coordinate image (Axes) Image title (Title) Line (line) Mark (marker) Legend (legend)
Set up Chinese
macOS plt.rcParams[“font.sans-serif”]=“Arial Unicode MS”
Windows plt.rcParams[“font.sans-serif”]=“SimHei”
Show the image plt.show()
Broken line diagram plot Histogram bar The line chart has linechar
Emphasize the change law of data over time Acquisition is It is very suitable for showing the journey overview at the same time
plt.plot() Set the required parameter x Axis y The value corresponding to the axis is passed into the function in turn
y The axis is time type data y The axis is the data corresponding to a time point
Integer is continuous data str It belongs to discontinuous data
TODO Use plt.plot() function
With data[“month”] by x The sum of the values of the axis data[“sum”] by y The value of the shaft , Draw line chart
plt.plot(data[“month”],data[“sum”],color=“orange”,marker=“o”,label=" Total monthly sales )
legend() Show Legend
TODO Use plt.show() Function to display the image
Add axis title Add image title plt.xlabel() plt.ylabel() plt.title()
Draw a histogram Show the data changes over a period of time or the comparison between various data x The axis is a time type Or category data y The axis is numerical data
plt.bar The parameters inside are the same as the line chart
label Used to set images and titles
Scatter plot Show the correlation and comparison values between the two data
The scatter chart can provide the following key information Whether there is a correlation trend If there is a trend Is it linear or nonlinear Whether there are outliers
color legend xlabel ylabel Nibbling is the same as before
Adjust the legend position In order to solve the problem of double y The legend of the axis overlay diagram overlaps
plt.twinx() The function represents drawing double x Axis overlay
Draw a composite image
Percentage stacked histogram
Clustered histogram
Compare multiple data on one dimension Draw a clustered histogram Just for one DataFrame object
Dyadic subgraph
x Axis and y The specific operation of the shaft is Calling plot.bar() Function time Index columns Or the list of fake case column indexes is passed into this function
data Variable usage plot.bar() function
data.plot.bar
Percentage stacked histogram
Show the relationship between a single item and the whole
data.plot.bar(“month”,[“ On the first floor ”,“ On the second floor ”,“ Third floor ”],stacked=True)
figure Is a coordinate graph Axes
adopt subplot() Row number of subgraphs Number of columns in a subgraph Sequence number of subgraph
Avoid axis occlusion rotate x Axis readable plt.xticks() Assign degrees as integers to rotation Parameters Passed in the function To rotate x Axis scale
plt.tight_layout() Function to adjust the layout of the subgraph
ax=plt.gca() It needs to be used in the drawing to return to the current
ax Parameters are used to specify coordinate graphics
pandas Modules cannot be like matplotlib.pyplot By default, the image will be drawn on the coordinate axis of the current sub image
边栏推荐
- Considerations for testing a website
- MySQL installation and configuration
- Detailed explanation of common APIs for component and container containers: frame, panel, scrollpane
- Option (024) - do all objects have prototypes?
- 746. Climb stairs with minimum cost
- C # symmetric encryption (AES encryption) ciphertext results generated each time, different ideas, code sharing
- QT qtablewidget table column top requirements ideas and codes
- Understanding of cross domain and how to solve cross domain problems
- 1、 Relevant theories and tools of network security penetration testing
- How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
猜你喜欢

Learn about the Internet of things protocol WiFi ZigBee Bluetooth, etc. --- WiFi and WiFi protocols start from WiFi. What do we need to know about WiFi protocol itself?

Leetcode question brushing record | 206_ Reverse linked list

SQL join, left join, right join usage

Sword finger offer II 038 Daily temperature

webrtc 快速搭建 视频通话 视频会议

如何实现视频平台会员多账号登录

Leakage detection relay jy82-2p

Detailed explanation of common APIs for component and container containers: frame, panel, scrollpane

AWT common components, FileDialog file selection box

LayoutManager布局管理器:FlowLayout、BorderLayout、GridLayout、GridBagLayout、CardLayout、BoxLayout
随机推荐
AWT introduction
C语言中的函数(详解)
Experience weekly report no. 102 (July 4, 2022)
Webrtc quickly set up video call and video conference
JSON web token -- comparison between JWT and traditional session login authentication
[Chongqing Guangdong education] electronic circuit homework question bank of RTVU secondary school
Compound nonlinear feedback control (2)
【无标题】
QT 获取随机颜色值设置label背景色 代码
雲原生——上雲必讀之SSH篇(常用於遠程登錄雲服務器)
Leakage detection relay jy82-2p
Reading notes of Clickhouse principle analysis and Application Practice (4)
Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs
ORICO ORICO outdoor power experience, lightweight and portable, the most convenient office charging station
ADC voltage calculation of STM32 single chip microcomputer
实用的小工具指令
C # symmetric encryption (AES encryption) ciphertext results generated each time, different ideas, code sharing
27-31. Dependency transitivity, principle
C language - Blue Bridge Cup - Snake filling
buuctf-pwn write-ups (8)