group_by
Get the first column of each group:
result = df.groupby('YourColumn', as_index=False).first()
include_groups
: whether to include the group keys as the first level of the resulting DataFrame
sort based on some columns
# method 1
df['sort_val'] = df['a'] * df['b']
df = df.sort_values('sort_val').drop('sort_val', 1)
# method 2
df = df.loc[(df['a'] * df['b']).sort_values().index]
# iloc has minor improvement in performance
df = df.iloc[(df['a']* df['b']).sort_values().index]