Skip to content

Commit fde5ed8

Browse files
committed
Updated set_index doc with a warning
1 parent 48b1571 commit fde5ed8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/frame.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5868,6 +5868,10 @@ def set_index(
58685868
columns or arrays (of the correct length). The index can replace the
58695869
existing index or expand on it.
58705870
5871+
.. warning::
5872+
Setting a new index will remove the current index column,
5873+
unless you first call `reset_index`.
5874+
58715875
Parameters
58725876
----------
58735877
keys : label or array-like or list of labels/arrays

0 commit comments

Comments
 (0)