Ivy Professional School
Rating
Learning/Python Data Drill #3

Student Performance & Scholarship Analysis

Last updated

Analyze student performance, grade category, scholarship eligibility, weakest subject, and class ranking.

PythonIntermediatePandasNumPyIf-ElseLambdaApplyRanking

Your Objective

Analyze student performance, grade category, scholarship eligibility, weakest subject, and class ranking.

The Setup

Your dataset contains a student_marks DataFrame with marks in three subjects and attendance percentage.

Table Schema

student_marks
ColumnTypeKey / Notes
student_idINTUnique student ID
student_nameVARCHAR(50)Student name
class_sectionVARCHAR(10)Student class section
mathsINTMarks scored in Maths
scienceINTMarks scored in Science
englishINTMarks scored in English
attendance_pctFLOATStudent attendance percentage

Sample Data

student_marks — 8 rows

student_idstudent_nameclass_sectionmathsscienceenglishattendance_pct
101AaravA85789092
102MeeraA72687588
103RohanB45524876
104PriyaA91889495
105KabirB60655881
106AnanyaB33403869
107DevA76817984
108IshaB95928997

Your Task

Calculate total marks and average marks for each student. Assign grade using average marks. Identify scholarship eligibility using marks and attendance. Find the weakest subject for each student. Rank students based on average marks.

Your output should look like this (partial example):

student_idstudent_nametotal_marksaverage_marksgradescholarship_statusweakest_subjectperformance_rank
108Isha27692.00AEligibleenglish1
104Priya27391.00AEligiblescience2
........................

Python Hint

  • →Use sum(axis=1) and mean(axis=1) for row-wise marks calculations.
  • →Use np.select for grade assignment and rank(method="dense") for ranking.
Explore Enterprise Solutions