Skip to content

Commit f0985d2

Browse files
committed
ERR: add stacklevel to to_dict() UserWarning (pandas-dev#16927)
1 parent 6858d0f commit f0985d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/frame.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,8 @@ def to_dict(self, orient='dict', into=dict):
972972
"""
973973
if not self.columns.is_unique:
974974
warnings.warn("DataFrame columns are not unique, some "
975-
"columns will be omitted.", UserWarning)
975+
"columns will be omitted.", UserWarning,
976+
stacklevel=2)
976977
# GH16122
977978
into_c = standardize_mapping(into)
978979
if orient.lower().startswith('d'):

0 commit comments

Comments
 (0)