pandas sort_index 文档

pandas sort_index documentation

DataFrame.sort_index 的 documentation 是:

DataFrame.sort_index(self, axis=0, level=None, ascending=True, inplace=False, kind='quicksort', na_position='last', sort_remaining=True, by=None)

但我找不到关于使用最后一个参数(by=)的任何信息。 [我知道如果没有给出参数 "by",则默认值为 None。] 任何人都知道这个参数的用途和使用方法吗?我发现这种不完整的文档令人沮丧...特别是因为大多数说明只是 "by example" 并且通常只涵盖基本用途。

每个源代码...

"if by is not None:

warnings.warn(

"by argument to sort_index is deprecated, "

"please use .sort_values(by=...)"