Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to sort values by index pandas

df = pd.DataFrame([1, 2, 3, 4, 5], index=[100, 29, 234, 1, 150],
...                   columns=['A'])
>>> df.sort_index()
     A
1    4
29   2
100  1
150  5
234  3
Source by pandas.pydata.org #
 
PREVIOUS NEXT
Tagged: #sort #values #index #pandas
ADD COMMENT
Topic
Name
6+9 =