• Skip to primary navigation
  • Skip to content
  • Skip to footer
Michael's Blog
  • About
  • Posts
  • Categories
  • Tags
  • Collections
  • Sitemap
    1. Home
    2. /
    3. Useful pandas recipes
    4. /
    5. Sorting
    • Useful pandas Recipes
      • Creating DataFrames
      • DataFrame Components
    • Select Data
      • Choose Columns
      • Choose Rows
      • Missing Data
    • Sorting
      • Sorting
    • Combining Data
      • Concatenation
      • Merge
    • Summarize Data
      • Summarize Data
    • Transform
      • Group By
      • Data Types
      • Headers
      • Reverse Rows
      • Transpose
      • Rename
      • Replace
      • Replace Missing
      • Melt (Unpivot)
      • Pivot
      • Tidy Data

    Sorting

    On this page

    • Sort by values
    • Sort by index
    • See also

    Sorting pandas DataFrames by value and index.

    Sort by values

    Sort a DataFrame by the values.

    Sort by index

    Sort a DataFrame by the index.

    See also

    • Sorting and order in pandas User Guide.
    • Sorting a MultiIndex in pandas User Guide.
    • pandas.DataFrame.sort_values
    • pandas.DataFrame.sort_index
    • pandas.DataFrame.reset_index

    Updated: January 20, 2021

    Previous Next
    • Follow:
    • Twitter
    • GitHub
    • Feed
    © 2021 Michael van der Nest. Powered by Jekyll & Minimal Mistakes.