Skip to content

Commit 6147831

Browse files
committed
ENH: Clarifies wording of warning message for column name collision
1 parent 6bcb426 commit 6147831

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
@@ -1788,9 +1788,9 @@ def _slice(self, slobj, axis=0, kind=None):
17881788

17891789
def _set_item(self, key, value):
17901790
if callable(getattr(self, key, None)):
1791-
warnings.warn("Pandas doesn't allow attribute-like access to "
1792-
"columns whose names collide with methods",
1793-
stacklevel=3)
1791+
warnings.warn("Column name '{key}' collides with a built-in "
1792+
"method, which will cause unexpected attribute "
1793+
"behavior".format(key=key), stacklevel=3)
17941794
self._data.set(key, value)
17951795
self._clear_item_cache()
17961796

0 commit comments

Comments
 (0)