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

BUG: csv w only header and no index_col failing #10413

Closed
jreback opened this issue Jun 23, 2015 · 1 comment · Fixed by #10469
Closed

BUG: csv w only header and no index_col failing #10413

jreback opened this issue Jun 23, 2015 · 1 comment · Fixed by #10469
Labels
IO CSV read_csv, to_csv Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Jun 23, 2015

after this fix #10302

The following is failing (as index_col is None)

In [9]: data
Out[9]: 'header1,header2\n'

In [10]: read_csv(StringIO(data),iterator=True,index_col=False).read()      
TypeError: object of type 'bool' has no len()
@ghost
Copy link

ghost commented Sep 17, 2015

I'm having the same issue with version 0.16.2. When reading a csv file that contains only headers (no data), for example:
first row: company;supplier;amount

And using pandas read_csv function to read the file (delimiter=";"; skiprows=0)
df = pd.read_csv(file, sep=delimiter, engine="c", quotechar='"', quoting=quote, skipinitialspace=True, skiprows=skiprows, prefix="NX", encoding="ISO-8859-1", error_bad_lines=False, index_col=False)

It returns the following error:
TypeError: object of type 'bool' has no len()

Removing the option index_col=False it starts working:
df = pd.read_csv(file, sep=delimiter, engine="c", quotechar='"', quoting=quote, skipinitialspace=True, skiprows=skiprows, prefix="NX", encoding="ISO-8859-1", error_bad_lines=False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant