![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python函数
土馒头二号
记录学习
展开
-
numpy.shape()函数
参考文章:https://blog.csdn.net/Mr_Cat123/article/details/78841747shape() 查看或数组的维数shape函数返回list,array,matrix等的一维和二维长度值。1)list列表列表只有一维,二维为0import numpy as npa = [1,2,3]print(np.shape(a))输出结果:(3,)...转载 2019-03-07 11:25:22 · 13097 阅读 · 0 评论 -
numpy.nonzero()函数
参考文章:https://blog.csdn.net/qq_28773183/article/details/81013226numpy.nonzero函数是numpy中用于得到数组array中非零元素的位置(数组索引)的函数.nonzero(a)返回数组a中非零元素的索引值数组。(1)只有a中非零元素才会有索引值,那些零值元素没有索引值;(2)返回的索引值数组是一个2维tuple数组,...转载 2019-03-07 21:15:30 · 1137 阅读 · 0 评论 -
numpy.logical_and/or/not()函数
参考文章:https://blog.csdn.net/qq_36523839/article/details/823180611. numpy.logical_and(逻辑与)# 所有数据皆从0开始索引 import numpy as npdf = np.array([[1,0,1],[2,2,0,],[0,3,2]]) # 原始矩阵print(df) 输出结果:[[1 0 1]...转载 2019-03-07 21:35:16 · 1216 阅读 · 0 评论 -
pandas.read_csv()函数
pandas.read_csv功能很简单,就是读取csv文本文件到DataFrame变量中。就是参数比较多。pandas.read_csv(诸多参数)参数详解:filepath_or_buffer : 字符串,文件路径,或者文件句柄,或者字符串IO字符串可能是一个URL。有效的URL方案包括http、ftp、s3和file。对于文件URL,需要主机名 。例如,本地文件可以是://local...原创 2019-03-16 20:34:03 · 4257 阅读 · 0 评论 -
python 中的re模块
参考文章https://blog.csdn.net/github_38196368/article/details/70456082Python 的 re 模块(Regular Expression 正则表达式)提供各种正则表达式的匹配操作,在文本解析、复杂字符串分析和信息提取时是一个非常有用的工具。1.re的简介使用python的re模块,尽管不能满足所有复杂的匹配情况,但足够在绝大多数情...转载 2019-03-16 21:34:29 · 460 阅读 · 0 评论