Pandas program to analyse the performance of student subject-wise with practical Example.

Given the school result data,analyse the performance of 5 students on different parameter, e.g. subject wise.

Program Logic:

  • Import matplotlib.pyplot in program using import statement
  • Import pandas module using import statement
  • Import numpy module using import statement
  • Create Dictionary object using different set of key value pair(i.e. subject and marks scored )
  • Create Dataframe object using DataFrame method and pass index say student name as an argument to it
  • Print DataFrame object using print function
  • Plot bar chart using plot method and pass kind = bar as an argument to it
  • Show bar chart using show method

Below is implementation code /source code

Here is program code to analyse the performance of student data on different parameter, e.g. subject wise or class wise

import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
marks  = { "English" :[67,89,90,55],
           "Chemistry" :[45,56,67,65],
df = pd.DataFrame(marks,index=['Sumedh','Athang','Sushil','Sujata'])
plt.xlabel(" ")
plt.ylabel(" ")

Below is output:

        English  Maths  IP  Chemistry  Biology
Sumedh       67     55  66         45       54
Athang       89     67  78         56       65
Sushil       90     45  89         67       76
Sujata       55     56  90         65       87

Below is bar chart showing performance of students subject-wise

Below is snapshot of executable code:

You can also check: