![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 83
Stupid小池
果壳研究僧/健身小白/前端开发学徒/ladygaga狂热粉
坚持写博客记录自己的学习,“Whether people show up or they don’t, you’re out
there, doing your thing, ready whenever they are.”
展开
-
OpenCV、cv、cv2的区别?
Officially, OpenCV releases two types of Python interfaces, cv and cv2.cv:I started working on cv. In this, all OpenCV data types are preserved as such. For example, when loaded, images are of format cvMat, same as in C++.For array operations, there are原创 2022-04-14 11:29:26 · 7045 阅读 · 2 评论 -
python二维list的截取
list不支持二维数组的区域切片功能(data = data[1:,1:]),会报错:list indices must be integers or slices, not tuple一个解决办法就是循环列表解析:#截取除了第一列的数据data = [tmp[1:] for tmp in data ]原创 2020-11-12 20:19:25 · 1625 阅读 · 0 评论 -
python语言特性:list赋值问题
碰到这样一道题 leetcode#88:要求:合并两个有序list,不return,直接修改nums1我用了一个长度n+m的temp变量存放,最后再把temp赋值给nums1,但是nums1=temp时出现了问题,看到一篇题解后恍然大悟正如题解里面所说注意到 python3 语言, 对象是一个盒子,有具体的地址,而变量名相当于是 “标签”,可以贴在盒子上。我们需要辨析:nums1 = A 和 nums1[:] = A 的不同之处:nums1 = A # 更改 nums1 这一变量名所指向原创 2020-08-14 12:12:15 · 191 阅读 · 0 评论 -
pandas数据分析:剔除数据相同或全为空的列
代码:def dropNullStd(data): beforlen = data.shape[1] colisNull = data.describe().loc['count']==0 #colisNull中1代表该列是空,0代表不为空 for i in range(len(colisNull)): if colisNull[i]: ...原创 2020-04-14 12:36:40 · 2749 阅读 · 0 评论 -
Python 的类的下划线命名有什么不同?
_xxx这表示这是一个保护成员(属性或者方法),它不能用from module import * 导入,其他方面和公有一样访问;__xxx 这表示这是一个私有成员,它无法直接像公有成员一样随便访问(比如直接print阿修改阿),当然,要想访问也可以,通过对象名._类名__xxx这样的方式可以访问;__xxx__这表示这是一个特殊成员,所谓特殊,就是例如__init__()、__del__()、...原创 2020-01-21 18:32:28 · 210 阅读 · 0 评论