wesm/pandas — Issue #226: read_csv should have better failure mode with spurious 'index' column
Author: takluyver
Created: 2011-10-12 14:53:39+00:00
State: open

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](http://pinard.progiciels-bpi.ca/libR/library/base/html/read.table.html) 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.