You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, when looking at the provided code snippet, we see that even though there is a label which is found in the selected axis ('A'), the KeyError is thrown.
Although from this issue, it seems like the code is at fault, I would suggest to change the documentation to KeyError: If one of the labels are not found in the selected axis. If the core team agrees with this fix, then I would be happy to provide a pull request that does this.
Code Sample, a copy-pastable example if possible
Problem description
In the pandas documentation for DataFrame drop (https://pandas-docs.github.io/pandas-docs-travis/reference/api/pandas.DataFrame.drop.html#pandas.DataFrame.drop), the following is mentioned:
KeyError: If none of the labels are found in the selected axis
However, when looking at the provided code snippet, we see that even though there is a label which is found in the selected axis (
'A'
), the KeyError is thrown.Expected Output
Suggested Fix
Although from this issue, it seems like the code is at fault, I would suggest to change the documentation to
KeyError: If one of the labels are not found in the selected axis
. If the core team agrees with this fix, then I would be happy to provide a pull request that does this.Output of
pd.show_versions()
pandas: 0.25.0.dev0+162.gc9863865c.dirty
pytest: 4.2.1
pip: 19.0.1
setuptools: 40.8.0
Cython: 0.29.5
numpy: 1.15.4
scipy: 1.2.0
pyarrow: 0.11.1
xarray: 0.11.3
IPython: 7.2.0
sphinx: 1.8.4
patsy: 0.5.1
dateutil: 2.7.5
pytz: 2018.9
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.9
feather: None
matplotlib: 3.0.2
openpyxl: 2.6.0
xlrd: 1.2.0
xlwt: 1.3.0
xlsxwriter: 1.1.2
lxml.etree: 4.3.1
bs4: 4.7.1
html5lib: 1.0.1
sqlalchemy: 1.2.18
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: 0.2.0
fastparquet: 0.2.1
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: