
Python
mabel92
分享有关学习数据分析、机器学习等知识的内容与总结。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
秒懂np.nonzero, np.argwhere, np.where
习惯用np.where,乍看到np.argwhere时没清楚干嘛又多个这玩意儿,干脆理一下。 先创建样本数据如下: np.nonzero 得到数据中非零值的索引数组,如果输入数据为list,则返回一个array,若为两维及以上数据,返回相应数量的array。 np.argwhere 如果仅输入数据,未设置条件,则相当于是np.nonzero的转置,即np.transpose(np.non...原创 2019-04-23 12:12:22 · 4059 阅读 · 0 评论 -
Python字符串之encode & decode
1. Encode 将str类型编码成bytes类型: >>>strs = '中文English' >>>strs.encode('utf-8') b'\xe4\xb8\xad\xe6\x96\x87English' >>>strs.encode('gb2312') ...原创 2019-05-13 16:30:25 · 316 阅读 · 0 评论