博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
pandas.DataFrame
阅读量:4210 次
发布时间:2019-05-26

本文共 1466 字,大约阅读时间需要 4 分钟。

pandas.DataFrame(data=None, index=None, columns=None, dtype=None, copy=False)[source]

Two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns). Arithmetic operations align on both row and column labels. Can be thought of as a dict-like container for Series objects. The primary pandas data structure

Parameters: data : numpy ndarray (structured or homogeneous), dict, or DataFrameDict can contain Series, arrays, constants, or list-like objectsindex : Index or array-likeIndex to use for resulting frame. Will default to np.arange(n) if no indexing information part of input data and no index providedcolumns : Index or array-likeColumn labels to use for resulting frame. Will default to np.arange(n) if no column labels are provideddtype : dtype, default NoneData type to force. Only a single dtype is allowed. If None, infercopy : boolean, default FalseCopy data from inputs. Only affects DataFrame / 2d ndarray input

例子:

>>> d = {
'col1': [1, 2], 'col2': [3, 4]}>>> df = pd.DataFrame(data=d)>>> df col1 col20 1 31 2 4

例子 2:

>>> df = pd.DataFrame(data=d, dtype=np.int8)>>> df.dtypescol1    int8col2    int8dtype: object

例子3

>>> df2 = pd.DataFrame(np.random.randint(low=0, high=10, size=(5, 5)),...                    columns=['a', 'b', 'c', 'd', 'e'])>>> df2    a   b   c   d   e0   2   8   8   3   41   4   2   9   0   92   1   0   7   8   03   5   1   7   1   34   6   0   2   4   2

转载地址:http://brgli.baihongyu.com/

你可能感兴趣的文章
MongoDB新的数据统计框架介绍
查看>>
mongodb 增加全文检索索引
查看>>
symfony
查看>>
softlayer 端口开放
查看>>
操作2:mongodb使用语法
查看>>
如何给分类增加一个属性(后台)
查看>>
linux设置环境变量 临时设置 和 永久设置
查看>>
mysql数据库主从同步的问题解决方法
查看>>
LoadRunner如何在脚本运行时修改log设置选项?
查看>>
QC数据库表结构
查看>>
自动化测试工具的3个关键部分
查看>>
测试工具厂商的编程语言什么时候“退休”?
查看>>
资源监控工具 - Hyperic HQ
查看>>
LoadRunner中Concurrent与Simultaneous的区别
查看>>
SiteScope - Agentless监控
查看>>
QTP测试.NET控件CheckedListBox
查看>>
使用QTP的.NET插件扩展技术测试ComponentOne的ToolBar控件
查看>>
用上帝之眼进行自动化测试
查看>>
为LoadRunner写一个lr_save_float函数
查看>>
PrefTest工作室全新力作-《性能测试与调优实战》课程视频即将上线
查看>>