![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
numpy
qq_23664173
这个作者很懒,什么都没留下…
展开
-
numpy矩阵运算
# 加载系统工具库 import numpy as np array1 = np.array([[2,3], [2,3], [2,3]]) array2 = np.array([[1,2,3], [1,2,3]]) array3 = np.dot(array1, array2) array4 = array3 + np.array([1,1,1]) print(array1) print(array2) print(array3) print(array4) 计算过程如下: ...原创 2020-07-25 17:50:28 · 96 阅读 · 0 评论 -
PyPI使用国内源
阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 豆瓣(douban) http://pypi.douban.com/simple/ 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ 中国科学技术大学 http://pypi...转载 2018-11-11 11:09:21 · 669 阅读 · 0 评论 -
Numpy总结(一)
1,np.arange(start,end,step) 生成类似range方法结果的数组 2,linspace(start,end,num) 生成满足等差数列的数组 3,logspace(start,end,num) 生成满足等比数列的数组, np.logspace(1,3,5,base=20),默认底数为10. 4,np.random.random() 生成0-1之间的随机数 5,np...原创 2018-11-18 18:21:07 · 139 阅读 · 0 评论 -
Numpy(二)
1,np.tile(arr,m) m 横向拉伸数组m次 2,np.tile(arr,[m,n]) m 纵向拉伸数组m次,横向拉伸n次 3,合并操作 stack([arr1,arr2]) 增加一个维度 4,np.vstack([scores,scores2]) vstack() 垂直方向的堆叠操作 5,np.hstack([scores,scores2]) hst...原创 2018-11-18 18:41:57 · 166 阅读 · 0 评论 -
Numpy(三)
聚合函数(最大值,最小值,平均值,方差,标准差) scores=np.array([[43, 86, 6, 49, 29], [23, 61, 48, 83, 6], [15, 25, 80, 53, 86], [ 1, 89, 14, 54, 42], [88, 37, 60, 53, 5]]) 班级成绩 1,np.amax(arr11) 班级的最高分...原创 2018-11-18 18:53:41 · 207 阅读 · 0 评论 -
numpy读入一张图片
PIL的九种不同模式:1,L,P,RGB,RGBA,CMYK,YCbCr,I,F、 from PIL import image img = image.open(“E:\image\myimg.jpg”) 一、模式“RGB”转换为其他不同模式 1、模式”1” 为二值图像,非黑即白。但是它每个像素用8个bit表示,0表示黑,255表示白。下面我们将lena图像转换为“1”图像。 from P...转载 2018-11-19 12:03:41 · 7005 阅读 · 2 评论