pandas通过索引进行排序
import pandas as pd
df = pd.DataFrame([1, 2, 3, 4, 5], index=[10, 52, 24, 158, 112], columns=['S'])
df.sort_index(inplace=True)
print(df)
pandas通过索引进行排序
import pandas as pd
df = pd.DataFrame([1, 2, 3, 4, 5], index=[10, 52, 24, 158, 112], columns=['S'])
df.sort_index(inplace=True)
print(df)