Skip to content

Commit 49488be

Browse files
committed
ENH: Clarifies wording of warning message for column name collision
1 parent cf5a845 commit 49488be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/generic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,9 +1907,9 @@ def _slice(self, slobj, axis=0, kind=None):
19071907

19081908
def _set_item(self, key, value):
19091909
if callable(getattr(self, key, None)):
1910-
warnings.warn("Pandas doesn't allow attribute-like access to "
1911-
"columns whose names collide with methods",
1912-
stacklevel=3)
1910+
warnings.warn("Column name '{key}' collides with a built-in "
1911+
"method, which will cause unexpected attribute "
1912+
"behavior".format(key=key), stacklevel=3)
19131913
self._data.set(key, value)
19141914
self._clear_item_cache()
19151915

0 commit comments

Comments
 (0)