Skip to content

object of type 'bool' has no len() on read_table() with index_col=False #10612

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
rubyfin opened this issue Jul 17, 2015 · 1 comment
Closed
Labels
Bug IO CSV read_csv, to_csv

Comments

@rubyfin
Copy link

rubyfin commented Jul 17, 2015

If you try to read a csv file into a dataframe, and the csv file has just the header and no rows, it throws 'object of type 'bool' has no len()'. This issue does not seem to exist in 0.16.1.

The sample csv file is blank:
id,strategyId,symbol,side,target,time,reason,epochTime

Code that causes the issue:

import pandas as pd
df = pd.read_table(path_to_csv, sep=',', index_col=False)

Code that does not have the issue:

import pandas as pd
df = pd.read_table(path_to_csv, sep=',')

INSTALLED VERSIONS

commit: None
python: 2.7.7.final.0
python-bits: 64

INSTALLED VERSIONSOS: Linux
OS-release: 2.6.32-431.3.1.el6.x86_64
machine: x86_64
processor: x86_64
byteorder: little

------------------LC_ALL: None

LANG: en_US.utf8
commit: None

pandas: 0.16.2
python: 2.7.7.final.0
nose: 1.3.4
python-bits: 64Cython: None

OS: Linuxnumpy: 1.9.2

OS-release: 2.6.32-431.3.1.el6.x86_64scipy: 0.15.1

machine: x86_64
statsmodels: None
processor: x86_64
IPython: None
byteorder: little
sphinx: 1.3.1
LC_ALL: None
patsy: None
LANG: en_US.utf8
dateutil: 2.4.2

pandas: 0.16.2pytz: 2015.4

nose: 1.3.4bottleneck: 1.0.0

Cython: Nonetables: None

numpy: 1.9.2numexpr: 2.4

scipy: 0.15.1matplotlib: 1.3.1

statsmodels: Noneopenpyxl: None

IPython: Nonexlrd: None

xlwt: Nonesphinx: 1.3.1

patsy: Nonexlsxwriter: None

dateutil: 2.4.2lxml: None

pytz: 2015.4bs4: None

bottleneck: 1.0.0html5lib: None

tables: Nonehttplib2: None

numexpr: 2.4apiclient: None

sqlalchemy: 0.9.8matplotlib: 1.3.1

pymysql: Noneopenpyxl: None

psycopg2: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
Nonehttplib2: None

apiclient: None
sqlalchemy: 0.9.8
pymysql: None
psycopg2: None
None

INSTALLED VERSIONS

commit: None
python: 2.7.7.final.0
python-bits: 64
OS: Linux
OS-release: 2.6.32-431.3.1.el6.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.utf8

pandas: 0.16.2
nose: 1.3.4
Cython: None
numpy: 1.9.2
scipy: 0.15.1
statsmodels: None
IPython: None
sphinx: 1.3.1
patsy: None
dateutil: 2.4.2
pytz: 2015.4
bottleneck: 1.0.0
tables: None
numexpr: 2.4
matplotlib: 1.3.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 0.9.8
pymysql: None
psycopg2: None
None

INSTALLED VERSIONS

commit: None
python: 2.7.7.final.0
python-bits: 64
OS: Linux
OS-release: 2.6.32-431.3.1.el6.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.utf8

pandas: 0.16.2
nose: 1.3.4
Cython: None
numpy: 1.9.2
scipy: 0.15.1
statsmodels: None
IPython: None
sphinx: 1.3.1
patsy: None
dateutil: 2.4.2
pytz: 2015.4
bottleneck: 1.0.0
tables: None
numexpr: 2.4
matplotlib: 1.3.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 0.9.8
pymysql: None
psycopg2: None

@jreback
Copy link
Contributor

jreback commented Jul 17, 2015

already fixed in #10469 (and in master).

ty for the report

@jreback jreback closed this as completed Jul 17, 2015
@jreback jreback added Bug IO CSV read_csv, to_csv labels Jul 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO CSV read_csv, to_csv
Projects
None yet
Development

No branches or pull requests

2 participants