We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa65ba5 commit d053e6cCopy full SHA for d053e6c
pandas/core/frame.py
@@ -5958,16 +5958,16 @@ def set_index(
5958
5959
Append a column to the existing index:
5960
5961
- >>> df.set_index("month", inplace=True)
5962
- >>> df.set_index("year", append=True)
+ >>> a = df.set_index("month")
+ >>> a.set_index("year", append=True)
5963
sale
5964
month year
5965
1 2012 55
5966
4 2014 40
5967
7 2013 84
5968
10 2014 31
5969
5970
- >>> df.set_index("year", append=False)
+ >>> a.set_index("year", append=False)
5971
5972
year
5973
2012 55
0 commit comments