import pandas as pd
my_data = pd.read_excel('D:\student.xlsx',index_col='id')
df=my_data['class1'].value_counts()
#print(my_out)
df.plot.line(title="Class and number of Marks");
Solution 2
import pandas as pd
my_data = pd.read_excel('D:\student.xlsx',index_col='id')
df=my_data[['class1','mark']].groupby(['class1']).agg(['mean'])
df.plot.bar(title="Class1 and Mean mark");
Solution 3
import pandas as pd
my_data = pd.read_excel('D:\student.xlsx',index_col='id')
df=my_data[['class1','mark']].groupby(['class1']).agg(['mean','max'])
df.plot.bar(title="Class with Mean and Max mark");
Solution 4
import pandas as pd
my_data = pd.read_excel('D:\student.xlsx',index_col='id')
df=my_data['class1'].value_counts()
#print(my_out)
df.plot.pie(title="Class with number of students");
Solution 5
import pandas as pd
my_data = pd.read_excel('D:\student.xlsx',index_col='id')
df=my_data['mark']
#print(my_out)
df.plot.density(title="Mark Density");
plot-line | Plotting line graph with different options |
plot-bar | Plotting bar graph with different options |
plot-barh | Plotting Horizontal bar graph with different options |
plot-hist | Histogram with different options |
plot-boxplot | boxplot with different options |
plot-pie | Pie diagram with different options |
plot-density | Density diagram with different options |
plot-area | Area diagram with different options |
plot-scatter | Scatter plot with different options |
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.