sort dataframe by value counts on a column pandas code example Example: dataframe value counts sort mt = mobile.PattLen.value_counts().sort_index()