Table Sort Operation
Jump to navigation
Jump to search
A Table Sort Operation is a tabular data structure operation that is a sort operation.
- AKA: Tabular Row Reorder Operation.
- Example(s):
- on a SQL Table:
SELECT * FROM tableX ORDER BY A DESC, C ASC, B DESC
- on a pandas.DataFrame:
df['a_bsum'] = df.groupby('A')['B'].transform(sum)
[1]
df.sort(['a_bsum','C'], ascending=[True, False]).drop('a_bsum', axis=1)
- on a SQL Table:
- See: Table Pivot Operation.