![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
numpy
step step
某高校硕士研究生在读,研究方向为深度学习,图像处理。
展开
-
numpy学习(一)
将数列转换成矩阵arr1 = np.array([[2,3,4], [3,4,5]])print (arr1)结果:[[2 3 4] [3 4 5]]生成零矩阵arr2 = np.zeros((2,3),dtype=np.int64).#创建一个两行三列的零矩阵,并定义为int64位print(arr2)print(arr2.dtype)结果:...原创 2019-05-03 22:15:39 · 131 阅读 · 0 评论 -
numpy(二)
矩阵乘法np.dot(a, b)#arraya,b矩阵相乘a.dot(b)#array a, b相乘a = np.ones((2 ,3))b = np.arange(6).reshape(3,2)print(a, b)print(np.dot(a,b))result:[[1. 1. 1.] [1. 1. 1.]] [[0 1] [2 3] [4 5]][[6. ...原创 2019-05-03 22:28:02 · 80 阅读 · 0 评论 -
numpy索引(三)
1.一维索引a = np.arange(3,15)print(a)print(a[3])#取下标为3的索引result:[ 3 4 5 6 7 8 9 10 11 12 13 14]62.二维索引b = a.reshape(3,4)print(b)print(b[1])#取第一行print(b[0,1])#取第0行,第1列print(b)print...原创 2019-05-04 10:30:43 · 247 阅读 · 0 评论 -
numpy坐标轴设置(四)
1.设置坐标轴名字,并调整间隔x = np.linspace(-2,2,100)y1 = x**2 - 1y2 = 3*x - 1plt.figure()#建立一个画布plt.plot(x,y1)#横为x,纵为y1plt.ylim(-1,0)#y的范围为-1-0plt.yticks([-1,-0.25,-0.75], ['$bad$','$normal$'...原创 2019-05-04 15:31:54 · 2745 阅读 · 0 评论 -
python中PIL库中的Image的用法
from PIL import Imageimport matplotlib.pyplot as plt img = Image.open("///home/paul/下载/faceExpressionClassification_FlyAI/data/ input/img/bright_KA.NE3.28.tiff"")#读入图片plt.imshow(img)plt.show(...原创 2019-05-04 19:16:12 · 1546 阅读 · 0 评论