-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: read_csv with empty header row raising #12494
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
Comments
thanks for the report. pull-requests welcome and desired! |
FYI: if you run your script, you actually will get a |
Addendum: It seems to be a certain number of comma's that break the parser. I did a quick test with the following function: def test(count):
s = StringIO(count * ',')
df = read_csv(s)
for i in range(1, 101):
try:
test(i)
except Exception as e:
print("{index} failed: {msg}".format(index=i, msg=str(e))) I get the following output (error messages truncated): 3 fails: Error tokenizing data...
6 fails: Error tokenizing data...
12 fails: Error tokenizing data...
24 fails: Error tokenizing data...
48 fails: Error tokenizing data...
96 fails: Error tokenizing data... So I guess what is it with |
Addresses issue in #12494 by allowing `grow_buffer` to grow the size of the parser buffer when buffer capacity is achieved. Previously, you had to exceed capacity for this to occur, but that was inconsistent with the `end_field` check later on when handling the EOF terminator, where reached capacity was considered a buffer overflow. Author: gfyoung <[email protected]> Closes #12504 from gfyoung/read_csv_empty_header and squashes the following commits: 8ba3dd0 [gfyoung] BUG: Fixed grow_buffer to grow when capacity is reached
Also close the issue! |
Thanks, much appreciated :) |
Code Sample, a copy-pastable example if possible
Expected Output
Current output:
Expected output:
output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: None
pandas: 0.17.1
nose: None
pip: 7.1.2
setuptools: 18.3.2
Cython: None
numpy: 1.10.1
scipy: 0.16.1
statsmodels: None
IPython: 4.0.1
sphinx: None
patsy: None
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.0
openpyxl: 2.3.2
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
Jinja2: 2.8
None
The text was updated successfully, but these errors were encountered: