Sort
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.
Get hands-on with 1400+ tech skills courses.