Suppose we read some data into a pandas data frame:
data1 = pd.read_csv(\"data.csv\", \"\\t\")
The content looks like this:
If you directly read the key as the index with
In [12]: df = pd.read_csv('data.csv', '\t', index_col='key')
In [13]: df
Out[13]:
val
key
A 0.1
B 0.4
C 0.3
D 0.5
E 0.2
you can use ix
to get the index in a different order and plot it using df.plot
:
In [14]: df.ix[list('CADFEB')].plot(kind='barh')
Out[14]:
(Note that F is not given in the data, but you gave it as an example)