Articles → Pandas → Sort_Values Function In Dataframe In Pandas
Sort_Values Function In Dataframe In Pandas
Purpose
Example
import pandas as pd
list = [[1,21,3], [4,5,6], [7, 8,9]]
df = pd.DataFrame(list, columns=['col1','col2','col3'])
df.sort_values('col2')
Output
Click to Enlarge