-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
unhelpful error message when header is a list of names in read_csv #16338
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
yeah this could be improved, always helpful to have unambiguous error messages. pull-requests welcome! |
@jreback I submitted a pull-request for this that raises an error very similar to the one @pierre-haessig suggests, but it looks like the Travis CI Build failed. Not entirely sure how to proceed. It's my first PR so apologies in advance if the process is a little painful. |
According to this test failure The second failure is more an actual test failure. You can view the output here which seems to be a plot failure. |
Thanks for the help! I'll take a look at those and see what needs to be done. |
FYI this now gives |
This is a minor issue about error reporting to the mindless user (me...) who confuses the
header
and thename
argument ofread_csv
. Basically, when callingread_csv
withheader=['a', 'b']
(whereas it should benames=['a', 'b']
), the error message is crytic:(pandas 0.20.1, see details below)
Two issues:
parsers.pyx
Here is code to reproduce the error message, taken from a IPython session. (First line may be a bit Unix specific, sorry. It's just to create a dummy CSV file)
Expected Output
I'm not expecting a fancy AI-assistant like error message. However, an early check of the header argument should verify, in coherence with the docstring, that
header
should beint or list of ints
.What do you think? Is it an overkill?
Output of
pd.show_versions()
pandas: 0.20.1
pytest: 3.0.5
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.25.2
numpy: 1.12.1
scipy: 0.19.0
xarray: None
IPython: 6.0.0
sphinx: 1.5.1
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: 1.2.0
tables: 3.3.0
numexpr: 2.6.2
feather: None
matplotlib: 2.0.2
openpyxl: 2.4.1
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: 0.9.6
lxml: 3.7.2
bs4: 4.5.3
html5lib: None
sqlalchemy: 1.1.5
pymysql: None
psycopg2: None
jinja2: 2.9.4
s3fs: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: