WillacyMe WillacyMe - 4 years ago 71
Python Question

How do you plot a bar graph for given values in a row rather than the number there are in the whole dataframe?

I just need a bar graph showing the

along the x-axis, and for the bars to match up with their
along the y-axis

series = pd.Series(np.arange(5))
df = pd.DataFrame(['Mel','James','Bob','Frank','Julia'], columns=['Name'])
df['Number'] = series

Name Number
0 Mel 5
1 James 6
2 Bob 7
3 Frank 8
4 Julia 9

Answer Source

Try setting the index


enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download