
一些技巧
莫叶何竹
微信公众号:莫叶何竹
个人主页:http://myhz0606.com/
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
numpy中的高维矩阵相乘机制
numpy/tensorflow/pytorch高维矩阵相乘机制举个栗子:import numpy as npa1 = np.array([[1, 2], [3, 5]])a2 = np.array([[2, 5], [3, 1]])A = np.stack([a1, a2], axis=0)A.shape, a1.shape>> ((2, 2, 2), (2, 2))b1 = np.array([[1, 2, 3], [1, 3, 5]])b2 = np.array([[原创 2021-04-12 15:36:36 · 1939 阅读 · 0 评论 -
python遇到TypeError: ‘method‘ object is not subscriptable
最大的可能是括号漏了,或者括号类型错了(中括号与小括号)。原创 2020-11-20 13:20:50 · 2668 阅读 · 0 评论 -
cv2.resize与PIL中resize的区别
PIL.Image.resizeImage.resize(size, resample=0)[source]'''Returns a resized copy of this image.参数: size – The requested size in pixels, as a 2-tuple: (width, height).resample – An optional resampling filter. This can be one of PIL.Image.NEAREST (use n原创 2020-11-19 09:50:46 · 2651 阅读 · 0 评论 -
设置自己的jupyter botebook样式
打开终端输入pip install --upgrade jupyterthemes再输入jt -t gruvboxl -f hasklig -fs 10 -cellw 90% -ofs 9 -dfs 9 -T完成设置。打开notebook观察效果原创 2020-11-05 11:15:59 · 190 阅读 · 0 评论 -
Cannot uninstall 'html5lib'. It is a distutils installed project and thus we cannot accurately....
转自 https://blog.youkuaiyun.com/qq_20373723/article/details/80323344如标题,安装Tensorflow-gpu时遇到的完整问题Cannot uninstall ‘html5lib’. It is a distutils installed project and thus we cannot accurately determine wh...转载 2019-07-21 23:24:38 · 198 阅读 · 0 评论 -
【解决】AttributeError: module 'pip' has no attribute 'main'和Cannot open D:\...pip-script.py
pip更新后出现AttributeError: module ‘pip’ has no attribute ‘main’Cannot open D:\Program Files\Anaconda3\Scripts\pip-script.py解决方法下载pip安装包https://pypi.org/project/pip/#downloads注意下载.gz的压缩包解压...原创 2019-07-16 16:31:42 · 533 阅读 · 0 评论 -
关于Numpy多维数组切片的方法及注意事项
1. 多维数组的切片定义Numpy的一个多维数组import numpy as npArrOne = np.arange(20).reshape(4,5)# np.arange(20),生成0-19,20长一维向量,通过reshape变成4*5的二维数组print("ArrOne ->> ", '\n', ArrOne)print("ArrOne的维度 ->> ...原创 2019-07-04 17:44:25 · 4051 阅读 · 0 评论 -
双系统安装Ubantu18.04 + RTX2070 + CUDA10.1 + Cudnn+anaconda3+tensorflow-gpu
双系统安装Ubantu18.04 + RTX2070 + CUDA10.1 + Cudnn7.5.1+anaconda3+tensorflow-gpu参考博客http://www.tuicool.com/articles/JvUvQjZhttps://blog.youkuaiyun.com/10km/article/details/61191230https://blog.youkuaiyun.com/wf199...原创 2019-05-22 22:12:00 · 3224 阅读 · 0 评论 -
计算pearson相关系数和spearman相关系数及kendall,python实现
pearson_coefficient = np.array(df_feature.corr(method=“pearson”).values) #皮尔逊相关系数df_feature为pandas的dataframespearman_coefficient = np.array(df_feature.corr(method=‘spearman’).values) #斯皮尔曼相关系数kend...原创 2019-05-20 22:21:28 · 2074 阅读 · 0 评论 -
pandas取某些列的方法
df_rawdata.loc[:,list(df_rawdata.columns)[3:]]取第3列后的所有列原创 2019-05-20 20:59:40 · 5719 阅读 · 3 评论