Apr-28-2017, 10:17 AM
It can be done similarly like you could do it with sql with window function (row_number over ordered group and take first).
table['sortcol'] = np.abs(table.Col2) table.sort('sortcol').groupby('Col1').first()followed by dropping of sortcol column