科学计算与可视化

NUMPY库

NumPy(Numerical Python) 是 Python 语言的一个扩展程序库,支持大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库。

NUMPY库函数使用

NUMPY函数属性

NUMPY库的计算函数

 

PYTHON123 成绩雷达图

代码:

import numpy as np
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['font.family']='SimHei'
matplotlib.rcParams['font.sans-serif']=['SimHei']
labels=np.array(['第二周','第三周','第四周','第五周','第六周'])
nAttr=5
Python=np.array([100,100,100,110,60])
angles=np.linspace(0,2*np.pi,nAttr,endpoint=False)
Python=np.concatenate((Python,[Python[0]]))
angles=np.concatenate((angles,[angles[0]]))
fig=plt.figure(facecolor="white")
plt.subplot(111,polar=True)
plt.plot(angles,Python,'bo-',color='g',linewidth=2)
plt.fill(angles,Python,facecolor='g',alpha=0.2)
plt.thetagrids(angles*180/np.pi,labels)
plt.figtext(0.52,0.95,'兴的成绩表    学号:2019310143116',ha='center')
plt.grid(True)
plt.savefig('dota_radar.JPG')
plt.show()

结果

原文地址:https://www.cnblogs.com/wjxk/p/12835691.html