How do I sort a pandas data-frame by column? I read here http://pandas.pydata.org/...sort_values about sort_values. When I run
df = pd.DataFrame([(2,'a'),(1,'b')],columns = ['num','let'])
df
df.sort_values(by='num', axis=1, ascending=True, inplace=True)
I obtain error KeyError: 'num'
axis=1, this is looking for index labels that match'num'