Repository: pandas-dev/pandas

Issue:
Error in documentation of DataFrame.drop
#### Code Sample, a copy-pastable example if possible

```python
df = pd.DataFrame(np.arange(12).reshape(3,4), columns=['A', 'B', 'C', 'D'])
df.drop(columns=['A','not_occurring'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py", line 3697, in drop
    errors=errors)
  File "/opt/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py", line 3111, in drop
    obj = obj._drop_axis(labels, axis, level=level, errors=errors)
  File "/opt/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py", line 3143, in _drop_axis
    new_axis = axis.drop(labels, errors=errors)
  File "/opt/anaconda3/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 4404, in drop
    '{} not found in axis'.format(labels[mask]))
KeyError: "['not_occurring'] not found in axis"

```
#### 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
```python
df = pd.DataFrame(np.arange(12).reshape(3,4), columns=['A', 'B', 'C', 'D'])
df.drop(columns=['A','not_occurring'])
   B   C   D
0  1   2   3
1  5   6   7
2  9  10  11
```

### 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()``
<details>
commit: None
python: 3.7.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.15.0-45-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

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
</details>



Discussion:

Resolving patch:
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -3797,7 +3797,12 @@ def drop(self, labels=None, axis=0, index=None, columns=None,
         axis : {0 or 'index', 1 or 'columns'}, default 0
             Whether to drop labels from the index (0 or 'index') or
             columns (1 or 'columns').
-        index, columns : single label or list-like
+        index : single label or list-like
+            Alternative to specifying axis (``labels, axis=0``
+            is equivalent to ``index=labels``).
+
+            .. versionadded:: 0.21.0
+        columns : single label or list-like
             Alternative to specifying axis (``labels, axis=1``
             is equivalent to ``columns=labels``).
 
@@ -3813,11 +3818,12 @@ def drop(self, labels=None, axis=0, index=None, columns=None,
         Returns
         -------
         DataFrame
+            DataFrame without the removed index or column labels.
 
         Raises
         ------
         KeyError
-            If none of the labels are found in the selected axis
+            If any of the labels is not found in the selected axis.
 
         See Also
         --------
@@ -3830,7 +3836,7 @@ def drop(self, labels=None, axis=0, index=None, columns=None,
 
         Examples
         --------
-        >>> df = pd.DataFrame(np.arange(12).reshape(3,4),
+        >>> df = pd.DataFrame(np.arange(12).reshape(3, 4),
         ...                   columns=['A', 'B', 'C', 'D'])
         >>> df
            A  B   C   D
@@ -3867,7 +3873,7 @@ def drop(self, labels=None, axis=0, index=None, columns=None,
         >>> df = pd.DataFrame(index=midx, columns=['big', 'small'],
         ...                   data=[[45, 30], [200, 100], [1.5, 1], [30, 20],
         ...                         [250, 150], [1.5, 0.8], [320, 250],
-        ...                         [1, 0.8], [0.3,0.2]])
+        ...                         [1, 0.8], [0.3, 0.2]])
         >>> df
                         big     small
         lama    speed   45.0    30.0


Test patch: