Skip to content

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

Closed
@rubyfin

Description

@rubyfin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions