本内容来自:https://gairuo.com
本页收集 pandas 的 api 及简单介绍,以供查阅,更加详细的介绍可参考教程,参数介绍可见官方文档。本文包含了 pandas.xxx、pandas.DataFrame.xxx、pandas.Series.xxx、 pandas.DataFrame.groupby()/pandas.Series.groupby() 等常用的对象属性和方法。
可使用浏览器自带的查询功能进行查询,快捷键一般是 ctr + F,如查询不到,不要将函数名称输全再试。
DataFrame
构造器 Constructor
DataFrame.add(other[, axis, level, fill_value])
加法 Addition(二元运算 radd)dataframe + other,下同
DataFrame.sub(other[, axis, level, fill_value])
减法 Subtraction (二元运算 sub),d - o
DataFrame.mul(other[, axis, level, fill_value])
乘法 Multiplication (二元运算 mul) ,d * o
DataFrame.div(other[, axis, level, fill_value])
浮点除 Floating division (二元运算 truediv),d / o
DataFrame.truediv(other[, axis, level, …])
浮点除 Floating division (二元运算 truediv),d / o
DataFrame.floordiv(other[, axis, level, …])
整除 Integer division (二元运算 floordiv),d // o
DataFrame.mod(other[, axis, level, fill_value])
模数 Modulo (二元运算 mod),d % o
DataFrame.pow(other[, axis, level, fill_value])
指数幂 Exponential power (二元运算 pow) ,
d ** o
DataFrame.dot(other)
矩阵乘法 matrix multiplication,d @ o(py 3.5+)
DataFrame.radd(other[, axis, level, fill_value])
加法 Addition,o + d,与上顺序相反(二元运算 radd)
DataFrame.rsub(other[, axis, level, fill_value])
(binary operator rsub).
DataFrame.rmul(other[, axis, level, fill_value])
(binary operator rmul).
DataFrame.rdiv(other[, axis, level, fill_value])
(binary operator rtruediv).
DataFrame.rtruediv(other[, axis, level, …])
(binary operator rtruediv).
DataFrame.rfloordiv(other[, axis, level, …])
(binary operator rfloordiv).
DataFrame.rmod(other[, axis, level, fill_value])
(binary operator rmod).
DataFrame.rpow(other[, axis, level, fill_value])
(binary operator rpow).
DataFrame.lt(other[, axis, level])
小于 Less than (二元运算 lt) ,d < o,对应位置的布尔值,下同
DataFrame.gt(other[, axis, level])
大于 Greater (二元运算 gt),d > o
DataFrame.le(other[, axis, level])
小于等于 Less than or equal to,(二元运算 le),d <= o
DataFrame.ge(other[, axis, level])
大于等于 Greater than or equal to, (二元运算 ge),d >= o
DataFrame.ne(other[, axis, level])
不等于 Not equal to,(二元运算 ne),d != o
DataFrame.eq(other[, axis, level])
等于 Equal to, (二元运算 eq),,d == o
DataFrame.combine(other, func[, fill_value, …])
与另一个 DataFrame 按列合并
DataFrame.combine_first(other)
在其他位置相同的位置更新具有值的空元素
函数应用/GroupBy/窗口 Function application, GroupBy & window
DataFrame.interpolate([method, axis, limit, …])
插值,对于多索引的DataFrame/Series,只支持method='linear'
DataFrame.isna()
检测缺失值
DataFrame.isnull()
检测缺失值
DataFrame.notna()
检测现有(非缺失)值
DataFrame.notnull()
检测现有(非缺失)值
DataFrame.pad([axis, inplace, limit, downcast])
同 DataFrame.fillna() 参数 method='ffill'
DataFrame.replace([to_replace, value, …])
整形/分类/换位 Reshaping, sorting, transposing
类似日期时间的属性 Datetimelike properties
Series.dt可用于以datetimelike的形式访问序列的值,并返回多个属性。可以像Series.dt.
一样访问这些属性。
日期时间属性 Datetime properties
分组 GroupBy
GroupBy 对象由 GroupBy 调用返回: pandas.DataFrame.groupby(), pandas.Series.groupby() 等。
Indexing, iteration
SeriesGroupBy.transform(func, *args[, …])
调用函数,在每个组上生成一个相似的索引序列,并返回一个序列,该序列具有与原始对象相同的索引,其中填充了转换后的值
DataFrameGroupBy.transform(func, *args[, …])
调用函数,在每个组上生成一个相似的索引数据帧,并返回一个数据帧,该数据帧的索引与原始对象的索引相同,并填充转换后的值
GroupBy.pipe(func, *args, **kwargs)
将带参数的函数func应用于此GroupBy对象并返回函数的结果
计算/描述性统计 Computations / descriptive stats
入门 pandas
pandas 中文简介
安装及环境搭建
安装 pandas
快速入门
数据结构
NumPy 基础用法
生成数据对象
序列 Series
数据框 DataFrame
数据类型 dtypes
pandas 功能介绍
文件读取和导出
有更新
索引 Indexing
有更新
数据的信息
有更新
数学统计
求值计算
有更新
查询筛选数据
有更新
数据类型转换
有更新
数据排序
有更新
数据添加修改
删除数据
数据迭代
函数应用
多层索引 MultiIndex
多层次索引 MultiIndex
创建分层索引对象
多层索引对象的操作
多层索引数据查询
多层索引的分组
数据合并场景和操作
有更新
数据连接 concat
多文件数据合并
数据追加 df.append
连接数据 pd.merge
有更新
时序数据合并
逐元素合并
数据对比
数据清洗操作
缺失值的判定
缺失值参与计算
缺失值填充
缺失值删除
插值填充
数据替换
缺失值 NA 标量
重复值
pandas 的聚合分组
Group By 基础使用
分组对象及创建
分组聚合统计
分组应用函数
分组对象的操作
分组器 Grouper
有更新
数据分箱
数据重塑透视
pandas 重塑透视
有更新
数据透视 Pivot Table
有更新
数据堆叠 Stack
有更新
交叉表 Crosstab
数据融合 Melt
有更新
虚拟变量/哑变量
数据转置 df.T
因子化(枚举化)值
爆炸序列
有更新
转为 NumPy ndarray
pandas 时间日期
时间基本概念
时间序列数据类型
固定时间
时间的属性操作
时间类型转换
时间范围
时间序列索引
时序数据方法
时间偏移
时间偏移对象
序列、索引和时间偏移
自定义工作日
时间偏移量别名
锚定偏移
假期日历
时间增量/时长
时长频率单位转换
时长的属性
时长索引
时间跨度
周期的操作
周期类型及转换
周期索引
超出时间戳范围时间
时间重采样
有更新
时间类型之间的转换
时区
区间间隔 Interval
pandas 文本处理
文本数据类型
字符的操作方法
文本分割
文本替换
文本连接
文本查询匹配
文本常用方法
pandas 样式
内置样式
显示格式
样式配置操作
样式应用函数
带样式文件的导出
pandas 可视化
Plot 绘图
Plotting 绘图模块
使用 Bokeh 可视化
matplotlib pyplot 绘图功能
使用 Plotly 可视化
Pyecharts 可视化绘图库
pandas 分类数据
分类数据创建
分类数据的使用
分类数据的顺序
分类数据的操作
分类数据处理
类别数据的读取
pandas 窗口计算
移动窗口函数 rolling
时间类型移动窗口
扩展窗口函数 expanding
函数 api
pandas.read_csv
pandas.read_excel
方法函数详细介绍
相关配置
异常和警告
函数 api 大全
●
生成测试数据
超大数据处理
有更新
链式方法
pandas 应用案例
有更新
pandas 练习题
有更新
pandas 速查手册
pandas 简明课程
教程更新日志
索引/迭代 Indexing, iteration
计算 (二元运算) Binary operator functions
函数应用/GroupBy/窗口 Function application, GroupBy & window
计算/描述性统计 Computations / descriptive stats
重新索引/选择/标签操作 Reindexing / selection / label manipulation
缺失数据处理 Missing data handling
整形/分类/换位 Reshaping, sorting, transposing
合并/比较/加入/合并 Combining / comparing / joining / merging
时间序列相关 Time Series-related
元数据 Metadata
绘图 Plotting
稀疏存取器 Sparse accessor
序列化/IO/转换 Serialization / IO / conversion
Series
构造器 Constructor
属性 Attributes
转换 Conversion
索引和迭代 Indexing, iteration
运算符功能 Binary operator functions
函数应用,分组和窗口计算 Function application, GroupBy & window
计算/描述性统计 Computations / descriptive stats
重新索引/选择/标签操作 Reindexing / selection / label manipulation
缺失值处理 Missing data handling
重塑/排序 Reshaping, sorting
合并/比较/合并/合并 Combining / comparing / joining / merging
时间序列有关 Time Series-related
存取器 Accessors
绘图 Plotting
序列化/IO/转换 Serialization / IO / conversion
分组 GroupBy
Indexing, iteration
函数应用 Function application
计算/描述性统计 Computations / descriptive stats
输入和输出 Input/output
Pickling
平面文件 Flat file
剪贴板 Clipboard
Excel
HDFStore: PyTables (HDF5)
Feather
Parquet
Google BigQuery
STATA
一般性功能 General functions
Data manipulations
Top-level missing data
Top-level conversions
Top-level dealing with datetimelike
固定频率 Top-level dealing with intervals
eval 操作 Top-level evaluation
散列操作 Hashing
测试 Testing