Loading

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 19 下一页
摘要: numpy.random 函数 功能描述 返回值 np.random.rand(d0,d1,…,dn) 元素在[0,1)区间均匀分布的数组 浮点数 np.random.uniform(low,hige, size) 元素在[low,hige)区间均匀分布的数组 浮点数 numpy.random.ra 阅读全文
posted @ 2021-03-26 16:58 克豪 阅读(72) 评论(0) 推荐(0)
摘要: numpy中矩阵和数组的对比 数组可以实现矩阵的所有功能,但是矩阵在实现一些功能的时候操作更加简便,比如矩阵的乘法直接使用A*B而不是使用函数,但是数组可以更加灵活的处理各种数据,而且可以表示高维数组,速度更快 numpy.matrix 创建矩阵 matrix ( 字符串/列表/元组/数组 ) ma 阅读全文
posted @ 2021-03-26 16:54 克豪 阅读(95) 评论(0) 推荐(0)
摘要: numpy中轴的概念是可以认为是数组的维度的概念 a = np.arange(24).reshape(2,3,4) a array([[[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]], [[12, 13, 14, 15], [16, 17, 18, 19 阅读全文
posted @ 2021-03-26 16:53 克豪 阅读(286) 评论(0) 推荐(0)
摘要: 1、numpy.where的返回结果 numpy.where调用方式为numpy.where(condition,1,2) 满足条件的位置上返回结果1,不满足的位置上返回结果2 例如通过where()函数将a数组中负值设为0,正值不变 如果没有指定返回结果,只有查找条件则返回满足条件的位置。返回的结 阅读全文
posted @ 2021-03-26 16:51 克豪 阅读(276) 评论(0) 推荐(0)
摘要: 参考 学习网址:https://blog.csdn.net/column/details/opencv-tutorial.html 1.cv::Mat类是用于保存图像以及其他矩阵数据的数据结构 2.imread函数 加载图像 用imread打开图片给Mat类对象 eg: Mat myMat= imr 阅读全文
posted @ 2021-03-26 16:50 克豪 阅读(129) 评论(0) 推荐(0)
摘要: 转载自:https://www.jianshu.com/p/b69950a49ae2 最终决定使用PicGo + 国内的github - 码云来实现markdown图床 废话说到这里,开始进入正题 1. 安装 PicGo picgo-plugin-gitee-uploader插件 首先打开picgo 阅读全文
posted @ 2021-03-26 16:49 克豪 阅读(311) 评论(0) 推荐(0)
摘要: import pandas as pd import numpy as np Series 创建Series 使用数组创建 可以使用Py原生的list类型,np的数组类型 a = pd.Series(np.arange(2,10,2)) print(a) 0 2 1 4 2 6 3 8 dtype: 阅读全文
posted @ 2021-03-26 16:47 克豪 阅读(68) 评论(0) 推荐(0)
摘要: 首先在当前用户目录下建立文件夹.pip,然后在文件夹中创建pip.conf文件,再将源地址加进去即可。 mkdir ~/.pip vim ~/.pip/pip.conf # 然后将下面这两行复制进去就好了 [global] index-url = https://mirrors.aliyun.com 阅读全文
posted @ 2021-03-26 16:46 克豪 阅读(136) 评论(0) 推荐(0)
摘要: 导入 from PIL import Image 加载图片和保存图片 在保存图片的时候会根据输入文件名的后缀名自动转换文件格式 image = Image.open(r'./lena.tiff') image.save(r'./lena.jpg') image.save(r'./lena.bmp') 阅读全文
posted @ 2021-03-26 16:45 克豪 阅读(233) 评论(0) 推荐(0)
摘要: 错误处理 try、except、finally 先执行try中的语句,如果发生了错误则被except捕获,否则无错误则执行else语句,最终执行finally语句 try: print('try...') r = 10 / int('2') print('result:', r) except Va 阅读全文
posted @ 2021-03-26 14:14 克豪 阅读(112) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 19 下一页