diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 6f743d7388574..f6853a1bbb748 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -4558,6 +4558,10 @@ def filter( >>> df = pd.DataFrame(np.array(([1, 2, 3], [4, 5, 6])), ... index=['mouse', 'rabbit'], ... columns=['one', 'two', 'three']) + >>> df + one two three + mouse 1 2 3 + rabbit 4 5 6 >>> # select columns by name >>> df.filter(items=['one', 'three'])