Sort and Rank in Pandas
Sort, as the name suggests, simply sorts a
Series object in ascending order. The
pandas package provides functions to sort both the indexes and their values. The following functions are used for this:
sort_index(): This function sorts the indexes in ascending order. It works on the alphabetic, numeric, and alphanumeric indexes. The non-numeric index values are treated as corresponding ASCII codes and sorted accordingly.