当前位置:网站首页>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
边栏推荐
- Json Web token - jwt vs. Traditional session login Authentication
- 8. Factory method
- Average two numbers
- Appium基础 — APPium安装(二)
- Error CVC complex type 2.4. a: Invalid content beginning with element 'base extension' was found. Should start with one of '{layoutlib}'.
- Learning multi-level structural information for small organ segmentation
- webrtc 快速搭建 视频通话 视频会议
- STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
- 采用中微BATG135实现IIC数据/指令交互
- 如何避免 JVM 内存泄漏?
猜你喜欢
我的NVIDIA开发者之旅——优化显卡性能
Reading notes of Clickhouse principle analysis and Application Practice (4)
[Android reverse] function interception (CPU cache mechanism | CPU cache mechanism causes function interception failure)
复合非线性反馈控制(二)
云原生——上云必读之SSH篇(常用于远程登录云服务器)
24 magicaccessorimpl can access the debugging of all methods
SQL injection SQL lab 11~22
Arcpy 利用updatelayer函数改变图层的符号系统
雲原生——上雲必讀之SSH篇(常用於遠程登錄雲服務器)
LayoutManager布局管理器:FlowLayout、BorderLayout、GridLayout、GridBagLayout、CardLayout、BoxLayout
随机推荐
24 magicaccessorimpl can access the debugging of all methods
AWT常用组件、FileDialog文件选择框
Overview of convolutional neural network structure optimization
QT QTableWidget 表格列置顶需求的思路和代码
Abap:ooalv realizes the function of adding, deleting, modifying and checking
Weekly summary (*63): about positive energy
Understanding of cross domain and how to solve cross domain problems
Manually page the list (parameter list, current page, page size)
C实现贪吃蛇小游戏
云原生——上云必读之SSH篇(常用于远程登录云服务器)
运算符<< >>傻瓜式测试用例
QT 获取随机颜色值设置label背景色 代码
Arcpy uses the updatelayer function to change the symbol system of the layer
采用中微BATG135实现IIC数据/指令交互
Matlab remainder
Fast power (template)
[openvino+paddle] paddle detection / OCR / SEG export based on paddle2onnx
[Android reverse] function interception (CPU cache mechanism | CPU cache mechanism causes function interception failure)
Tree DP
JS how to convert seconds into hours, minutes and seconds display