sort and save pandas dataframe code example Example: python dataframe sort by column name >>> result = df.sort(['A', 'B'], ascending=[1, 0])