Tag: How To Sort DataFrame Based On Index?


  • How To Sort DataFrame Based On Index?

    How To Sort DataFrame Based On Index?

    How To Sort DataFrame Based On Index? Table Of Contents: Syntax ‘sort_index( )’ Method In Pandas. Examples ‘sort_index( )’ Method. (1) Syntax: DataFrame.sort_index(*, axis=0, level=None, ascending=True, inplace=False, kind=’quicksort’, na_position=’last’, sort_remaining=True, ignore_index=False, key=None) Description: Sort object by labels (along an axis). Returns a new DataFrame sorted by label if inplace argument is False, otherwise updates the original DataFrame and returns None. Parameters: axis: {0 or ‘index’, 1 or ‘columns’}, default 0 – The axis along which to sort. The value 0 identifies the rows, and 1 identifies the columns. level: int or level name or list of ints or list of level names –

    Read More