数据框具有
sort_index默认情况下返回副本的方法。通过
inplace=True*** 作就位。
import pandas as pddf = pd.Dataframe([1, 2, 3, 4, 5], index=[100, 29, 234, 1, 150], columns=['A'])df.sort_index(inplace=True)print(df.to_string())
给我:
A1 429 2100 1150 5234 3
欢迎分享,转载请注明来源:内存溢出
数据框具有
sort_index默认情况下返回副本的方法。通过
inplace=True*** 作就位。
import pandas as pddf = pd.Dataframe([1, 2, 3, 4, 5], index=[100, 29, 234, 1, 150], columns=['A'])df.sort_index(inplace=True)print(df.to_string())
给我:
A1 429 2100 1150 5234 3
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)