diff --git a/pandas/core/ops.py b/pandas/core/ops.py index 55473ec8d7cad..b3d30f58c528e 100644 --- a/pandas/core/ops.py +++ b/pandas/core/ops.py @@ -149,13 +149,15 @@ def names(x): def add_methods(cls, new_methods, force, select, exclude): if select and exclude: raise TypeError("May only pass either select or exclude") - methods = new_methods + if select: select = set(select) methods = {} for key, method in new_methods.items(): if key in select: methods[key] = method + new_methods = methods + if exclude: for k in exclude: new_methods.pop(k, None)