├── README.md ├── student_marks.csv └── student_analysis.py /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Samridhan2005/student-mark-analysis/HEAD/README.md -------------------------------------------------------------------------------- /student_marks.csv: -------------------------------------------------------------------------------- 1 | Name,Math,Science,English,History,Geography,Com.Science 2 | Alice,85,92,78,90,98,80 3 | Bob,65,70,91,89,78,79 4 | Carol,88,88,69,81,79,89 5 | David,75,80,89,66,98,99 6 | Eve,90,87,74,79,90,94 7 | sam,90,90,90,90,90,90 8 | lakshman,78,98,67,89,87,69 9 | tharun,93,79,88,76,79,90 10 | karthi,60,79,81,74,95,80 11 | sabari,68,89,92,59,76,45 12 | varun,89,59,60,90,89,56 13 | tilak,79,81,90,98,91,87 14 | -------------------------------------------------------------------------------- /student_analysis.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import matplotlib.pyplot as plt 3 | 4 | # Load the CSV file into a DataFrame 5 | df = pd.read_csv(r'E:\python_miniproject\student_marks.csv') 6 | 7 | 8 | # Calculate the average marks for each student across all subjects 9 | df['Average'] = df[['Math', 'Science', 'English', 'History', 'Geography', 'Com.Science']].mean(axis=1) 10 | 11 | # Display the results (name and average marks) 12 | print(df[['Name', 'Average']]) 13 | 14 | # Bar chart for average marks per student 15 | plt.figure(figsize=(8, 5)) 16 | plt.bar(df['Name'], df['Average'], color='skyblue') 17 | plt.title('Average Marks of Each Student') 18 | plt.xlabel('Student') 19 | plt.ylabel('Average Marks') 20 | plt.xticks(rotation=40) 21 | plt.show() 22 | --------------------------------------------------------------------------------