index_col : int or sequence or False, default None

用作行索引的列编号或者列名,如果给定一个序列则有多个行索引。
如果文件不规则,行尾有分隔符,则可以设定index_col=False 来使得pandas不使用第一列作为行索引。
 
如:

train_df = pd.read_csv('./input/train.csv')
print train_df.columns结果:

Index([u'Id', u'MSSubClass', u'MSZoning', u'LotFrontage', u'LotArea',
u'Street', u'Alley', u'LotShape', u'LandContour', u'Utilities',
u'LotConfig', u'LandSlope', u'Neighborhood', u'Condition1',
u'Condition2', u'BldgType', u'HouseStyle', u'OverallQual',
u'OverallCond', u'YearBuilt', u'YearRemodAdd', u'RoofStyle',
u'RoofMatl', u'Exterior1st', u'Exterior2nd', u'MasVnrType',。。。]

train_df = pd.read_csv('./input/train.csv', index_col=0)结果:

Index([u'MSSubClass', u'MSZoning', u'LotFrontage', u'LotArea', u'Street',
u'Alley', u'LotShape', u'LandContour', u'Utilities', u'LotConfig',
u'LandSlope', u'Neighborhood', u'Condition1', u'Condition2',
u'BldgType', u'HouseStyle', u'OverallQual', u'OverallCond',
u'YearBuilt', u'YearRemodAdd', u'RoofStyle', u'RoofMatl',
u'Exterior1st', u'Exterior2nd', u'MasVnrType',。。。]


pandas.read_csv 参数 index_col=0的更多相关文章

  1. pandas.read_csv()参数(转载)

    文章转载地址 pandas.read_csv参数整理 读取CSV(逗号分割)文件到DataFrame 也支持文件的部分导入和选择迭代 更多帮助参见:http://pandas.pydata.org/p ...

  2. pandas.read_csv参数详解

    读取CSV(逗号分割)文件到DataFrame 也支持文件的部分导入和选择迭代 更多帮助参见:http://pandas.pydata.org/pandas-docs/stable/io.html 参 ...

  3. pandas.read_csv参数整理

    读取CSV(逗号分隔)文件到DataFrame,也支持文件的部分导入和选择迭代 更多帮助参见:http://pandas.pydata.org/pandas-docs/stable/io.html 参 ...

  4. pandas.read_csv to_csv参数详解

    pandas.read_csv参数整理   读取CSV(逗号分割)文件到DataFrame 也支持文件的部分导入和选择迭代 更多帮助参见:http://pandas.pydata.org/pandas ...

  5. 被 Pandas read_csv 坑了

    被 Pandas read_csv 坑了 -- 不怕前路坎坷,只怕从一开始就走错了方向 Pandas 是python的一个数据分析包,纳入了大量库和一些标准的数据模型,提供了高效地操作大型数据集所需的 ...

  6. pandas.read_csv() 部分参数解释

    read_csv()所有参数 pandas.read_csv( filepath_or_buffer, sep=',', delimiter=None, header='infer', names=N ...

  7. API:详解 pandas.read_csv

    pandas.read_csv 作为常用的读取数据的常用API,使用频率非常高,但是API中可选的参数有哪些呢? pandas项目代码 答案是: .read_csv(filepath_or_buffe ...

  8. pd.read_csv参数解析

    对pd.read_csv参数做如下解释: pandas.read_csv(filepath_or_buffer, sep=', ', delimiter=None, header='infer', n ...

  9. pandas.read_csv用法(转)

    的数据结构DataFrame,几乎可以对数据进行任何你想要的操作. 由于现实世界中数据源的格式非常多,pandas也支持了不同数据格式的导入方法,本文介绍pandas如何从csv文件中导入数据. 从上 ...

随机推荐

  1. Jmeter 之 ServerAgent 在性能测试的时候通过插件监听数据库状态

    https://jmeter-plugins.org/downloads/old/ 下载几个jar包,导入到Jmeter对应到目录下/lib/ext文件夹下,注意只支持Jmeter3.2(不含)以下版 ...

  2. MongoDB(课时29 MapReduce)

    3.7.4 MapReduce MapReduce 是整个大数据的精髓所在(实际中别用,因为在MongoDB中属于最底层操作). MapReduce是一种计算模型,简单的说就是将大批量的工作分解执行, ...

  3. 《Blue Flke》团队项目需求改进与系统设计

    Github地址:https://github.com/13993013291/ruanjianguigexuqiu/tree/master 一.团队项目需求分析改进 1.<通讯录管理系统需求说 ...

  4. 修改unity变量名但不丢失序列化值

    using UnityEngine; using UnityEngine.Serialization; public class LgsTest : MonoBehaviour { [Formerly ...

  5. php file_get_contents计时读取一个文件/页面 防止读取不到内容

    php file_get_contents计时读取一个文件/页面 防止读取不到内容 $url = 'http://www.baidu.com/index.php'; $opts = array( 'h ...

  6. 『cs231n』注意力模型

    RNN实现文本标注: 弊端是图像信息只在初始化时有用到 Soft Attention模型: 每一层具有三个输入:隐藏状态 + 注意力特征向量 + 词向量 每一层具有两个输出:新的位置分布(指示下一次‘ ...

  7. C++中的赋值运算符重载函数(operator=)

    MyStr& operator =(const MyStr& str)//赋值运算符 { cout << "operator =" << e ...

  8. iterator not dereferencable问题

    STL中的迭代器总是出现各种问题,这个是我在打表达式求值时碰到的... 综合网上的答案,一般来说有两种情况: 第一:访问了非法位置. 一般来说可能在queue为空时取front(),rear(),或者 ...

  9. PaodingAnalysis 提示 "dic home should not be a file, but a directory"

    Exception in thread "main" net.paoding.analysis.exception.PaodingAnalysisException: dic ho ...

  10. 在linux中,如何增加、修改、删除、暂停和冻结用户名

    在Linux中,如何增加.修改.删除.暂停和冻结用户名 在操作增加.修改和删除用户名前,先认识linux中两个最重要的文件,它们就是账号管理最重要文件“/etc/passwd”与“etc/shadow ...