Skip to content

Commit 28622c5

Browse files
HonzaOsobnegfyoung
authored andcommitted
Fixed 'add_methods' when the 'select' argument is specified. (pandas-dev#17045)
1 parent d884e51 commit 28622c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/ops.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,15 @@ def names(x):
149149
def add_methods(cls, new_methods, force, select, exclude):
150150
if select and exclude:
151151
raise TypeError("May only pass either select or exclude")
152-
methods = new_methods
152+
153153
if select:
154154
select = set(select)
155155
methods = {}
156156
for key, method in new_methods.items():
157157
if key in select:
158158
methods[key] = method
159+
new_methods = methods
160+
159161
if exclude:
160162
for k in exclude:
161163
new_methods.pop(k, None)

0 commit comments

Comments
 (0)