Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_csv: passing index_col results in KeyError #714

Closed
willfurnass opened this issue Sep 16, 2015 · 1 comment · Fixed by #724
Closed

read_csv: passing index_col results in KeyError #714

willfurnass opened this issue Sep 16, 2015 · 1 comment · Fixed by #724
Milestone

Comments

@willfurnass
Copy link

Sample data:

"id1","id2","attr1","attr2","attr3","attr4"
1072.0,"2014-02-22 12:30:00",1,93440248,"False",750
1072.0,"2014-02-22 12:45:00",1,93440248,"False",765
1072.0,"2014-02-22 13:00:00",1,93440248,"False",780
1072.0,"2014-02-22 13:15:00",1,93440248,"False",795

The following results in a KeyError (full stack trace on pastebin.com):

dask_df = dd.read_csv('test.csv',  index_col='id1')

However, setting the index column using the set_index method works (e.g. as follows) for single-columned indexes (MultiIndexes are not yet supported in Dask).

dask_df = dd.read_csv('test.csv')
dask_df = dask_df.set_index('id1')

Issue detected when using Dask 0.7.1 and pandas 0.16.2.

@mrocklin
Copy link
Member

Indexes have to be a bit more strange when working in parallel. I think that, for the moment we should just raise an informative error pointing people to use set_index explicitly.

mrocklin added a commit that referenced this issue Sep 21, 2015
Add error for using `set_index` in read_csv
@sinhrks sinhrks added this to the 0.7.2 milestone Sep 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants