Skip to content

Commit 99d0be8

Browse files
committed
BUG: removes warning when a column name may collide with a method
Closes pandas-dev#17268 and reverts work from pandas-dev#16951 which warns users when creating a column whose name matches one of the methods defined on ndframes (e.g. 'sum' or 'mean'). The warning was deemed to be too much of a hindrance to the common use case of generating dataframes of summary statistics.
1 parent 58d8729 commit 99d0be8

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

pandas/core/generic.py

-4
Original file line numberDiff line numberDiff line change
@@ -1907,10 +1907,6 @@ def _slice(self, slobj, axis=0, kind=None):
19071907
return result
19081908

19091909
def _set_item(self, key, value):
1910-
if isinstance(key, str) and callable(getattr(self, key, None)):
1911-
warnings.warn("Column name '{key}' collides with a built-in "
1912-
"method, which will cause unexpected attribute "
1913-
"behavior".format(key=key), stacklevel=3)
19141910
self._data.set(key, value)
19151911
self._clear_item_cache()
19161912

0 commit comments

Comments
 (0)