From cfa92f168e00b36afd40622f8822fd0cf043f312 Mon Sep 17 00:00:00 2001 From: Jan Novotny Date: Fri, 21 Jul 2017 13:48:31 +0200 Subject: [PATCH] Fixed 'add_methods' when the 'select' argument is specified. --- pandas/core/ops.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)