-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: raise on header=bool in parsers #11182
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
Conversation
#GH 6114 | ||
with tm.assertRaises(TypeError): | ||
pd.read_excel(os.path.join(self.dirpath, 'test1' + self.ext), | ||
header=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test for True as well (in read_csv too)
@chris-b1 if you add a release note (put in the API section) can add for 0.17.0 |
20f5147
to
eec2252
Compare
@jreback added a doc note and testing for the True case. |
|
||
In earlier versions of pandas, if a bool was passed the ``header`` argument of | ||
``read_csv``, ``read_excel``, or ``read_html`` it was implicitly converted to | ||
an integer, resulting in ``header=0`` for ``False`` and ``header=1`` for ``True`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the issue number here
tiny doc-change. ping when you push |
eec2252
to
5697abb
Compare
@jreback thanks, made that change |
API: raise on header=bool in parsers
thank you sir! |
Nice! |
closes #6113
Passing
header=True|False
toread_csv
(and brethren),read_excel
, andread_html
will now raise aTypeError
, rather than being coerced to an int.I had thought about converting
False
toNone
but thought that could break someone's code in a very subtle way if they were somehow depending on the old behavior. But happy to change that if it seems better.If you want to push this in for 0.17 I can add a doc-note or this could easily wait.