Python数据工程师实战案例教程第7章课后习题答案.docxVIP

  • 0
  • 0
  • 约小于1千字
  • 约 2页
  • 2026-01-21 发布于湖南
  • 举报

Python数据工程师实战案例教程第7章课后习题答案.docx

第7章课后习题答案

一、单选题

1.B

2.A

3.A

4.D

5.A

二、填空题

1.pie

2.xlim

3.font.sans-serif

4.subplot函数

5.折线图、散点图、柱状图、条形图、饼图、直方图、线形图等。

三、程序设计题

1.面向对象的方式面向对象的方式

importmatplotlib.pyplotasplt

importnumpyasnp

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()

2.面向函数的方式

importmatplotlib.pyplotasplt

importnumpyasnp

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()

程序运行结果:

文档评论(0)

1亿VIP精品文档

相关文档