I have the following data frame:
df = pandas.DataFrame([{\'c1\':3,\'c2\':10},{\'c1\':2, \'c2\':30},{\'c1\':1,\'c2\':20},{\'c1\':2,\'c2\':15},{\'c1\':2,\'c2\'
Note : Everything up here is correct,just replace sort --> sort_values() So, it becomes:
import pandas as pd df = pd.read_csv('data.csv') df.sort_values(ascending=False,inplace=True)
Refer to the official website here.