没有合适的资源?快使用搜索试试~ 我知道了~
首页【Python】Pandas中DataFrame基本函数及举例整理
本文部分网络整理,部分个人整理 目录介绍Pandas中DataFrame基本函数整理(全)构造数据框属性和数据类型转换索引和迭代二元运算函数应用&分组&窗口描述统计学从新索引&选取&标签操作处理缺失值从新定型&排序&转变形态Combining& joining&merging时间序列作图转换为其他格式例子导入包pandas.DataFramepandas.DataFrame.dtypespandas.DataFrame.headpandas.DataFrame.tailpandas.DataFrame.indexpandas.DataFrame.to_numpypandas.DataFram
资源详情
资源评论
资源推荐

【【Python】】Pandas中中DataFrame基本函数及举例整理基本函数及举例整理
本文部分网络整理,部分个人整理本文部分网络整理,部分个人整理
目录目录介绍Pandas中DataFrame基本函数整理(全)构造数据框属性和数据类型转换索引和迭代二元运算函数应用&分组&窗口描述统计学从新索引&选取&标签操作处理缺失值从新定型&排序&转变形态
Combining& joining&merging时间序列作图转换为其他格式例子导入包
pandas.DataFramepandas.DataFrame.dtypespandas.DataFrame.headpandas.DataFrame.tailpandas.DataFrame.indexpandas.DataFrame.to_numpypandas.DataFrame.describepandas.DataFrame.Tpandas.DataFrame.sort_indexpandas.DataFrame.sort_valuesgettingdf[‘A’]df[0:3]pandas.DataFrame.locpandas.DataFrame.atpandas.DataFrame.ilocpandas.DataFrame.iatdf[df[‘A’]
> 0]df[df > 0]pandas.DataFrame.copydf3[‘E’]pandas.DataFrame.isinDataFrame中的赋值pandas.DataFrame.reindexpandas.DataFrame.dropnapandas.DataFrame.fillna 给DataFrame中的空值赋值
pandas.DataFrame.meanpandas.DataFrame.sub 减法,元素指向pandas.DataFrame.apply 函数应用
介绍介绍
DataFrame:一个表格型的数据结构,包含有一组有序的列,每列可以是不同的值类型:一个表格型的数据结构,包含有一组有序的列,每列可以是不同的值类型(数值、字符串、布尔型等数值、字符串、布尔型等),,DataFrame即有行索引也有列索引,可以被看做是由即有行索引也有列索引,可以被看做是由Series组成的字典。组成的字典。
Pandas中中DataFrame基本函数整理(全)基本函数整理(全)
原文链接
构造数据框构造数据框
DataFrame([data, index, columns, dtype, copy]) #构造数据框
属性和数据属性和数据
DataFrame.axes #index: 行标签;columns: 列标签
DataFrame.as_matrix([columns]) #转换为矩阵
DataFrame.dtypes #返回数据的类型
DataFrame.ftypes #返回每一列的 数据类型float64:dense
DataFrame.get_dtype_counts() #返回数据框数据类型的个数
DataFrame.get_ftype_counts() #返回数据框数据类型float64:dense的个数
DataFrame.select_dtypes([include, include]) #根据数据类型选取子数据框
DataFrame.values #Numpy的展示方式
DataFrame.axes #返回横纵坐标的标签名
DataFrame.ndim #返回数据框的纬度
DataFrame.size #返回数据框元素的个数
DataFrame.shape #返回数据框的形状
DataFrame.memory_usage() #每一列的存储
类型转换类型转换
DataFrame.astype(dtype[, copy, errors]) #转换数据类型
DataFrame.copy([deep]) #deep深度复制数据
DataFrame.isnull() #以布尔的方式返回空值
DataFrame.notnull() #以布尔的方式返回非空值
索引和迭代索引和迭代
DataFrame.head([n]) #返回前n行数据
DataFrame.at #快速标签常量访问器
DataFrame.iat #快速整型常量访问器
DataFrame.loc #标签定位,使用名称
DataFrame.iloc #整型定位,使用数字
DataFrame.insert(loc, column, value) #在特殊地点loc[数字]插入column[列名]某列数据
DataFrame.iter() #Iterate over infor axis
DataFrame.iteritems() #返回列名和序列的迭代器
DataFrame.iterrows() #返回索引和序列的迭代器
DataFrame.itertuples([index, name]) #Iterate over DataFrame rows as namedtuples, with index value as first element of the tuple.
DataFrame.lookup(row_labels, col_labels) #Label-based “fancy indexing” function for DataFrame.
DataFrame.pop(item) #返回删除的项目
DataFrame.tail([n]) #返回最后n行
DataFrame.xs(key[, axis, level, drop_level]) #Returns a cross-section (row(s) or column(s)) from the Series/DataFrame.
DataFrame.isin(values) #是否包含数据框中的元素
DataFrame.where(cond[, other, inplace, …]) #条件筛选
DataFrame.mask(cond[, other, inplace, …]) #Return an object of same shape as self and whose corresponding entries are from self where cond is False and otherwise are from other.
DataFrame.query(expr[, inplace]) #Query the columns of a frame with a boolean expression.
二元运算二元运算
DataFrame.add(other[,axis,fill_value]) #加法,元素指向
DataFrame.sub(other[,axis,fill_value]) #减法,元素指向
DataFrame.mul(other[, axis,fill_value]) #乘法,元素指向
DataFrame.div(other[, axis,fill_value]) #小数除法,元素指向
DataFrame.truediv(other[, axis, level, …]) #真除法,元素指向
DataFrame.floordiv(other[, axis, level, …]) #向下取整除法,元素指向
DataFrame.mod(other[, axis,fill_value]) #模运算,元素指向
DataFrame.pow(other[, axis,fill_value]) #幂运算,元素指向
DataFrame.radd(other[, axis,fill_value]) #右侧加法,元素指向
DataFrame.rsub(other[, axis,fill_value]) #右侧减法,元素指向
DataFrame.rmul(other[, axis,fill_value]) #右侧乘法,元素指向
DataFrame.rdiv(other[, axis,fill_value]) #右侧小数除法,元素指向
DataFrame.rtruediv(other[, axis, …]) #右侧真除法,元素指向
DataFrame.rfloordiv(other[, axis, …]) #右侧向下取整除法,元素指向
DataFrame.rmod(other[, axis,fill_value]) #右侧模运算,元素指向
DataFrame.rpow(other[, axis,fill_value]) #右侧幂运算,元素指向
DataFrame.lt(other[, axis, level]) #类似Array.lt
DataFrame.gt(other[, axis, level]) #类似Array.gt
DataFrame.le(other[, axis, level]) #类似Array.le
DataFrame.ge(other[, axis, level]) #类似Array.ge
DataFrame.ne(other[, axis, level]) #类似Array.ne
DataFrame.eq(other[, axis, level]) #类似Array.eq
DataFrame.combine(other,func[,fill_value, …]) #Add two DataFrame objects and do not propagate NaN values, so if for a
DataFrame.combine_first(other) #Combine two DataFrame objects and default to non-null values in frame calling the method.
函数应用函数应用&分组分组&窗口窗口
DataFrame.apply(func[, axis, broadcast, …]) #应用函数
DataFrame.applymap(func) #Apply a function to a DataFrame that is intended to operate elementwise, i.e.
DataFrame.aggregate(func[, axis]) #Aggregate using callable, string, dict, or list of string/callables
DataFrame.transform(func, *args, **kwargs) #Call function producing a like-indexed NDFrame
DataFrame.groupby([by, axis, level, …]) #分组
DataFrame.rolling(window[, min_periods, …]) #滚动窗口
DataFrame.expanding([min_periods, freq, …]) #拓展窗口
DataFrame.ewm([com, span, halflife, …]) #指数权重窗口
描述统计学描述统计学
DataFrame.abs() #返回绝对值
DataFrame.all([axis, bool_only, skipna]) #Return whether all elements are True over requested axis
DataFrame.any([axis, bool_only, skipna]) #Return whether any element is True over requested axis
DataFrame.clip([lower, upper, axis]) #Trim values at input threshold(s).
DataFrame.clip_lower(threshold[, axis]) #Return copy of the input with values below given value(s) truncated.
DataFrame.clip_upper(threshold[, axis]) #Return copy of input with values above given value(s) truncated.
DataFrame.corr([method, min_periods]) #返回本数据框成对列的相关性系数
DataFrame.corrwith(other[, axis, drop]) #返回不同数据框的相关性
DataFrame.count([axis, level, numeric_only]) #返回非空元素的个数
DataFrame.cov([min_periods]) #计算协方差
DataFrame.cummax([axis, skipna]) #Return cumulative max over requested axis.
DataFrame.cummin([axis, skipna]) #Return cumulative minimum over requested axis.
DataFrame.cumprod([axis, skipna]) #返回累积
DataFrame.cumsum([axis, skipna]) #返回累和
DataFrame.describe([percentiles,include, …]) #整体描述数据框
DataFrame.diff([periods, axis]) #1st discrete difference of object
DataFrame.eval(expr[, inplace]) #Evaluate an expression in the context of the calling DataFrame instance.
DataFrame.kurt([axis, skipna, level, …]) #返回无偏峰度Fisher’s (kurtosis of normal == 0.0).
DataFrame.mad([axis, skipna, level]) #返回偏差
DataFrame.max([axis, skipna, level, …]) #返回最大值
DataFrame.mean([axis, skipna, level, …]) #返回均值
DataFrame.median([axis, skipna, level, …]) #返回中位数
DataFrame.min([axis, skipna, level, …]) #返回最小值
DataFrame.mode([axis, numeric_only]) #返回众数
DataFrame.pct_change([periods, fill_method]) #返回百分比变化
DataFrame.prod([axis, skipna, level, …]) #返回连乘积



















weixin_38640473
- 粉丝: 8
- 资源: 950
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
最新资源
- Xilinx SRIO详解.pptx
- Informatica PowerCenter 10.2 for Centos7.6安装配置说明.pdf
- 现代无线系统射频电路实用设计卷II 英文版.pdf
- 电子产品可靠性设计 自己讲课用的PPT,包括设计方案的可靠性选择,元器件的选择与使用,降额设计,热设计,余度设计,参数优化设计 和 失效分析等
- MPC5744P-DEV-KIT-REVE-QSG.pdf
- 通信原理课程设计报告(ASK FSK PSK Matlab仿真--数字调制技术的仿真实现及性能研究)
- ORIGIN7.0使用说明
- 在VMware Player 3.1.3下安装Redhat Linux详尽步骤
- python学生信息管理系统实现代码
- 西门子MES手册 13 OpcenterEXCR_PortalStudio1_81RB1.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制

评论0