Skip to content

read_csv should have better failure mode with spurious 'index' column #226

Closed
@takluyver

Description

@takluyver

If I use read_csv to load a datafile with the default index_col, but the first column does not have unique values, it succeeds at first, but when I try to select rows later, I get Exception: Index cannot contain duplicate values!. This raises a couple of points:

  1. Should the default be to use an index column? My data often doesn't have one. Apparently R takes the first column as an index if it doesn't have a header, and otherwise does an integer index.
  2. Non-unique values should be detected when we're creating the index, and either leave that column as a regular column (falling back to an integer index), or raise an exception at that point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions