Skip to content

Commit dfc90eb

Browse files
committed
ENH: Clarifies wording of warning message for column name collision
1 parent 9fb5bcd commit dfc90eb

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

18261826
def _set_item(self, key, value):
18271827
if callable(getattr(self, key, None)):
1828-
warnings.warn("Pandas doesn't allow attribute-like access to "
1829-
"columns whose names collide with methods",
1830-
stacklevel=3)
1828+
warnings.warn("Column name '{key}' collides with a built-in "
1829+
"method, which will cause unexpected attribute "
1830+
"behavior".format(key=key), stacklevel=3)
18311831
self._data.set(key, value)
18321832
self._clear_item_cache()
18331833

0 commit comments

Comments
 (0)