Enhanced_Student_Data_Processing_System
Enhanced_Student_Data_Processing_System
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
1. **Install Python**: Ensure Python 3.7+ is installed. You can download it from
https://www.python.org.
```
```
3. **Prepare the Data**: Save a CSV file (e.g., `students.csv`) with columns such as Name, Subject,
and Marks.
- 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**:
3. **Analyze Data**:
4. **Visualize Data**:
5. **Save Data**:
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
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
if __name__ == "__main__":
root = Tk()
app = StudentDataProcessor(root)
root.mainloop()