pandas.DataFrame 详解

DataFrame 数据准备

参数

参数格式说明
datandarray (structured or homogeneous),
Iterable,
dict,
or DataFrame
字典可以包含序列、数组、常量或类似列表的对象
indexIndex
or array-like
columnsIndex
or array-like
dtypedtype, default None强制设置数据类型,只允许一个dtype,如果是None,则自动判断
copyboolean, default False

属性

属性说明
T列和行互换
at根据行和列获取/设置某元素。例:df.at[4,'B'] or df.at.[4,'B'] = 10
axes返回一个列表,行和列的数据的格式
columns返回数据 DataFrame
dtypes返回数据 DataFrame 的 dtypes.
empty数据 DataFrame 是否为空,返回 True or False.
ftypesReturn the ftypes (indication of sparse/dense and dtype) in DataFrame.(数据密度???)
iat根据整数访问行和列的单个值。例:df.iat[1,2] or df.iat[1,2] = 10
ilocPurely integer-location based indexing for selection by position.
index返回数据 DataFrame 行.
is_copyReturn the copy.
ixA primarily label-location based indexer, with integer position fallback.
loc获取列 df.loc[1] or df.loc[[0,1]]
ndimReturn an int representing the number of axes / array dimensions.
shape返回数据 DataFrame 维数的元组(行和列的数量).
size对象元素数量
styleProperty returning a Styler object containing methods for building a styled HTML representation fo the DataFrame.
values返回 DataFrameNumpy 格式

方法

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值