bach.DataFrame.sort_index

sort_index

(level=None, ascending=True)

[source]

Sort dataframe by index levels.

Parameters

  • level (Optional[Union[int, List[int], str, List[str]]]) – int or level name or list of ints or level names. If not specified, all index series are used
  • ascending (Union[bool, List[bool]]) – Whether to sort ascending (True) or descending (False). If this is a list, then the level must also be a list and len(ascending) == len(level).

Returns

a new DataFrame with the specified ordering, otherwise it updates the original and returns None.

Return type

bach.dataframe.DataFrame