Given this code:
s = pd.Series([1,2,3], index=['C','B','A'])
s.sort_index(inplace=True)
You shouldn't slook like this now :
A 3
B 2
C 1
dtype: int64
When I run this, it sremains unchanged. Perhaps I am confused by what the argument should do inplace. I thought he should have changed the series on which the method is being called.
For the record, this returns a sorted series, but it does this if you set it inplaceto True.
source
share