Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: unhelpful parser exception when passing names and dtype #8833

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

Closed
jreback opened this issue Nov 16, 2014 · 1 comment · Fixed by #8834
Closed

BUG: unhelpful parser exception when passing names and dtype #8833

jreback opened this issue Nov 16, 2014 · 1 comment · Fixed by #8834
Labels
Bug Error Reporting Incorrect or improved errors from pandas IO CSV read_csv, to_csv
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Nov 16, 2014

In [1]: data = """1.0 1
   ...: 2.0 2
   ...: 3.0 3"""

In [2]: read_csv(StringIO(data),sep='\s+')
Out[2]: 
   1.0  1
0    2  2
1    3  3

In [3]: read_csv(StringIO(data),sep='\s+',header=None)
Out[3]: 
   0  1
0  1  1
1  2  2
2  3  3

In [4]: read_csv(StringIO(data),sep='\s+',header=None,names=['a','b'])
Out[4]: 
   a  b
0  1  1
1  2  2
2  3  3

In [6]: read_csv(StringIO(data),sep='\s+',header=None,names=['a','b'],dtype={'a' : int})
'NoneType' object has no attribute 'dtype'
@jreback jreback added Bug Error Reporting Incorrect or improved errors from pandas IO CSV read_csv, to_csv labels Nov 16, 2014
@jreback jreback added this to the 0.15.2 milestone Nov 16, 2014
@mrocklin
Copy link
Contributor

Thanks for raising this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error Reporting Incorrect or improved errors from pandas IO CSV read_csv, to_csv
Projects
None yet
2 participants