Pandas DataFrame Plot barh graph
Python Pandas Pandas Plot
Python Pandas Plot horizontal or vertical Bar graph by using DataFrame with options & save as image
VIDEO
Pandas.DataFrame.plot to get bar graphs using data
Let us create a DataFrame with name of the students and their marks.
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()
Author & Instructor at
plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery,
and web development at plus2net. The tutorials focus on clear explanations, working
examples, and code that readers can test and adapt while learning.
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com