0% found this document useful (0 votes)
2 views

Enhanced_Student_Data_Processing_System

2nd

Uploaded by

hxhshxbsnsnzn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Enhanced_Student_Data_Processing_System

2nd

Uploaded by

hxhshxbsnsnzn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Student Data Processing System

Student Data Processing System (Enhanced)

This project allows users to process and analyze student data using Python. It includes features

such as data cleaning, analysis, and visualization, with an easy-to-use graphical interface.

1. Setup Instructions

### Setup Instructions

1. **Install Python**: Ensure Python 3.7+ is installed. You can download it from

https://www.python.org.

2. **Install Required Libraries**:

Run the following commands in your terminal or command prompt:

```

pip install pandas matplotlib tkinter

```

3. **Prepare the Data**: Save a CSV file (e.g., `students.csv`) with columns such as Name, Subject,

and Marks.

### Running the Program

- Run the Python script in your IDE or terminal.

- The GUI will open, allowing you to load, clean, analyze, and visualize the data.

2. Workflow
Student Data Processing System

### Workflow

1. **Load Data**:

- Select a CSV file containing student data using the 'Load Data' button.

2. **Clean Data**:

- Missing or invalid data in the Marks column is automatically handled.

- Missing values are replaced with the average Marks.

3. **Analyze Data**:

- Calculate average Marks.

- Identify the top-performing student.

4. **Visualize Data**:

- Bar chart: Shows average Marks by subject.

- Pie chart: Displays Marks distribution across all students.

5. **Save Data**:

- Optionally save the cleaned data for future use.

3. Complete Python Code

import pandas as pd
import matplotlib.pyplot as plt
from tkinter import Tk, Button, Label, filedialog, messagebox

class StudentDataProcessor:
def __init__(self, root):
self.root = root
Student Data Processing System

self.root.title("Student Data Processing System")


self.data = None

Label(root, text="Welcome to Student Data Processor", font=("Arial",


16)).pack(pady=10)
Button(root, text="Load Data", command=self.load_data, font=("Arial",
12)).pack(pady=5)
Button(root, text="Clean Data", command=self.clean_data, font=("Arial",
12)).pack(pady=5)
Button(root, text="Analyze Data", command=self.analyze_data, font=("Arial",
12)).pack(pady=5)
Button(root, text="Visualize Data", command=self.visualize_data, font=("Arial",
12)).pack(pady=5)

def load_data(self):
file_path = filedialog.askopenfilename(filetypes=[("CSV files", "*.csv")])
if file_path:
self.data = pd.read_csv(file_path)
messagebox.showinfo("Success", "Data loaded successfully!")

def clean_data(self):
if self.data is not None:
self.data['Marks'] = pd.to_numeric(self.data['Marks'], errors='coerce')
self.data['Marks'].fillna(self.data['Marks'].mean(), inplace=True)
messagebox.showinfo("Success", "Data cleaned successfully!")
else:
messagebox.showerror("Error", "Please load the data first.")

def analyze_data(self):
if self.data is not None:
avg_marks = self.data['Marks'].mean()
top_performer = self.data.loc[self.data['Marks'].idxmax()]
result = (
f"Average Marks: {avg_marks:.2f}\n"
f"Top Performer: {top_performer['Name']} ({top_performer['Marks']:.2f}
marks)"
)
messagebox.showinfo("Analysis Report", result)
else:
messagebox.showerror("Error", "Please load and clean the data first.")

def visualize_data(self):
if self.data is not None:
avg_marks = self.data.groupby('Subject')['Marks'].mean()
avg_marks.plot(kind='bar', color='skyblue', title="Average Marks by
Subject")
plt.xlabel("Subject")
plt.ylabel("Average Marks")
plt.show()
Student Data Processing System

self.data['Marks'].plot(kind='pie', autopct='%1.1f%%', title="Marks


Distribution", startangle=90)
plt.ylabel("")
plt.show()
else:
messagebox.showerror("Error", "Please load and clean the data first.")

if __name__ == "__main__":
root = Tk()
app = StudentDataProcessor(root)
root.mainloop()

You might also like