程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python data visualization_ Exercises and answers after class

編輯:Python

link :https://pan.baidu.com/s/1PlSosvbXm_jiNQYZ-VK6MA
Extraction code :y8ma

The first 1 Chapter Data visualization and Application matplotlib

One 、 Completion

1. graphics
2. Chart
3. Box chart
4.2D
5.Anaconda

Two 、 Judgment questions

1.√
2.×
3.×
4.×

3、 ... and 、 choice question

1.C
2.C
3.D
4.D
5.A,B,C,D

Four 、 Short answer

1. answer : Data visualization aims to use graphical means , Represent a set of data in a graphical form , And using data analysis and development tools to find the processing process of unknown information .
2. answer : Line chart is to mark data into points , And connect these points in a certain order through a straight line , It reflects the changing trend of things along a certain dimension in the form of broken lines , It can clearly show the trend of data increase and decrease 、 rate 、 Characteristics such as regularity and peak value ; A column chart consists of a series of equal widths 、 A chart composed of uneven vertical rectangular bars , It uses the height of the rectangular bar to indicate how much data , To reflect the differences between different classification data ; The pie chart is composed of several areas of different sizes 、 A circular chart composed of sectors of different colors , It uses circles to represent the total amount of data , Each sector forming a circle represents the proportion of each item in the total data , It is mainly used to display the ratio between the size of each item and the sum of each item in the data .
3. answer : When using pyplot API When drawing , Users need to use “import matplotlib.pyplot as plt” Statement import pyplot modular , Then use this module to call the drawing function to draw charts in the current canvas and drawing area ; When using object-oriented API When drawing , Users need to create canvas first (pyplot.Figure Class object ), Then create a coordinate system style drawing area on the canvas (pyplot.Axes Class object ), Then call the drawing method to create the graph , These created objects are combined to complete a complete drawing .

5、 ... and 、 Programming questions

answer :

# ———— The object-oriented approach 
import numpy as np
import matplotlib.pyplot as plt
x_data = np.linspace(-np.pi, np.pi, 256, endpoint=True)
y_sin, y_cos = np.sin(x_data), np.cos(x_data)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x_data, y_sin)
ax.plot(x_data, y_cos)
plt.show()
# ———— Function oriented approach 
import numpy as np
import matplotlib.pyplot as plt
x_data = np.linspace(-np.pi, np.pi, 256, endpoint=True)
y_sin, y_cos = np.sin(x_data), np.cos(x_data)
plt.plot(x_data, y_sin)
plt.plot(x_data, y_cos)
plt.show()

The first 2 Chapter Use matplotlib Draw a simple chart

One 、 Completion

1.Line2D
2. Stacked graph
3.10

Two 、 Judgment questions

1.×
2.√
3.×

3、 ... and 、 choice question

1.D
2.C
3.B
4.D
5.C

The first 3 Chapter Customization of chart auxiliary elements

One 、 Completion

1. graphics
2. identification
3. Indicating arrow
4. Reference line
5. The mathematical formula

Two 、 Judgment questions

1.×
2.√
3.×
4.√
5.√

3、 ... and 、 choice question

1.B
2.C
3.B
4.A
5.D

Four 、 Short answer

1. answer : Directional annotation text refers to the text that interprets the graphics in the drawing area through the annotation method of indicating arrows , It usually uses lines to connect the annotation text pointed by the description point and the arrow ; Non directional annotation text refers to the text that simply uses the annotation method of text to explain the graphics in the drawing area .
2. answer : A coordinate axis is a set of lines or curves used to define a coordinate system ; The title is the name of the chart , It can quickly make readers understand what the chart is about ; The legend is a block diagram of each group of graphic identification methods listed , It can help users clarify the meaning of each group of graphics ; The grid starts from the scale of the coordinate axis 、 Several lines running through the drawing area , Used as a standard for estimating the values shown in the graph ; The reference line is a straight line marking the special value on the coordinate axis ; The reference area is an area marking a special range on the coordinate axis ; Note text is some notes and descriptions of graphics ; Tables are mainly used to emphasize data that are difficult to understand .


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved