Skip to content

DataFrame.from_csv undocumented behavior of index_col #9556

Closed
@EntilZha

Description

@EntilZha

Took me a while to find this (in the end by stackoverflow), but I ran into the problem while trying to parse a csv file. Panda kept parsing the first column as the index column instead of generating a new index. I could not find a way to disable this after reading the docs here:

http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.from_csv.html

As it turns out, due to the line of code below, if the argument is set to False, then it has the behavior I desired. This is completely undocumented and would be very helpful to have. I haven't contributed before to Pandas, so if it is more than a quick change a maintainer can make, I could put the work in for a PR, even if its just documentation changes.

https://github.com/pydata/pandas/blob/master/pandas/io/parsers.py#L1064

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions