Mini Project: Student Records Analyzer
using Pandas
Project Overview:
This mini-project is designed to help students practice basic and intermediate
functionalities of the Pandas library in Python.
Students will create, manipulate, analyze, and export student data using DataFrames.
✅ Project Tasks:
1. Create a DataFrame with at least 10 students. Each student record must contain:
- Name (string): اسم الطالب
- Subject (string): المادة
- Grade (integer): الدرجة
- Attendance (percentage, float): نسبة الحضور
- Passed (boolean): ( هل الطالب ناجح أم الTrue/False)
2. Perform the following analyses:
- Calculate the **average grade** of all students.
- Display a list of **students who passed**.
- Display a list of **students whose grade is above the average**.
- Count how many students studied each **subject**.
- Find the **maximum and minimum grade**.
- Add a new column `Status`:
- "Good" if grade >= 60
- "Needs Improvement" if grade < 60
3. Export the final DataFrame (with the new "Status" column) to a CSV file named
`student_analysis.csv`
🌟 Bonus Tasks ()اختياري:
- Read the initial student data from a CSV file (instead of entering it manually).
- Create simple visualizations (bar chart or pie chart) using `matplotlib` or
`pandas.plot()`.
- Use conditional formatting in Pandas to highlight rows with grades below 60.
📊 Example Data Table: apply like this but not the same data
Name Subject Grade Attendance Passed
Ali Math 75 90 True
Sara English 65 85 True
Omar Math 40 60 False
Noor Science 95 100 True
Submission Requirements:
- Submit your Python code in a `.py` or `.ipynb` file. with your name
- Submit the generated `student_analysis.csv` file.
- If you created visualizations, include screenshots or the code used. not necessary
Useful Pandas Functions to Explore:
Here are some useful Pandas functions students can use and explore in this project:
- `pd.DataFrame()` - Create a DataFrame
- `df.head()` / `df.tail()` - View first/last rows
- `df.info()` - Overview of data structure
- `df.describe()` - Summary statistics
- `df.mean()` / `df.max()` / `df.min()` - Statistical summaries
- `df.groupby()` - Grouping data
- `df.sort_values()` - Sorting data
- `df.loc[]` / `df.iloc[]` - Access rows and columns
- `df.drop()` - Drop rows or columns
- `df.fillna()` / `df.isnull()` - Handle missing values
- `df.apply()` - Apply custom functions
- `df.to_csv()` / `pd.read_csv()` - File I/O