Pandas DataFrame Plot barh graph

Pandas plot

Pandas.DataFrame.plot to get bar graphs using data

Let us create a DataFrame with name of the students and their marks. Horizontal DataFrame bar graph
import pandas as pd 
my_dict={
'NAME':['Ravi','Raju','Alex',
        'Ron','Geek','Kim'],
'MARK':[20,30,40,30,30,30]
}
df = pd.DataFrame(data=my_dict)
df.plot.barh(title="rot=180",x='NAME',
        y='MARK',figsize=(5,3),rot=45)

Bar Graph with options

There are several options we can add to above bar graph and they are same as plot.bar. So read the options of bar graph.

Pandas plot Bar Graph plot.bar()

Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here





    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2021 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer