0% found this document useful (0 votes)
5 views2 pages

Ipproject

Uploaded by

c.naman933
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Ipproject

Uploaded by

c.naman933
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

04/02/2025, 20:32 Untitled0.

ipynb - Colab

import pandas as pd
import matplotlib.pyplot as plt

# Load the marks from the CSV file into a DataFrame


path="/content/drive/MyDrive/ip/helo.csv"
df = pd.read_csv(path, index_col='Student')

# Display the DataFrame


print("Marks of 40 students in 3 subjects:")
print(df)

# Visualizing the data: Bar plot of average marks per subject


average_marks = df.mean()

# Plotting the bar chart


plt.figure(figsize=(8, 5))
average_marks.plot(kind='bar', color='skyblue')

# Adding title and labels


plt.title('Average Marks of Students in 3 Subjects', fontsize=14)
plt.xlabel('Subjects', fontsize=12)
plt.ylabel('Average Marks', fontsize=12)

# Display the plot


plt.show()

# Visualizing the data: Pie chart for marks distribution (percentage) for each subject
subject_totals = df.sum()

# Plotting the pie chart


plt.figure(figsize=(8, 8))
plt.pie(subject_totals, labels=df.columns, autopct='%1.1f%%', startangle=90, colors=['lightblue', 'lightgreen', 'lightcoral']

# Adding title
plt.title('Total Marks Distribution Across Subjects', fontsize=14)

# Display the plot


plt.show()
Student 37 48 57 65
Student 38 92 95 94
Student 39 64 73 80
Student 40 72 80 65

https://colab.research.google.com/drive/161kMwJD1idtF9eeLkRI7GRioMB6vLkka?authuser=0#scrollTo=38_FIBwmTg1S&printMo… 1/2
04/02/2025, 20:32 Untitled0.ipynb - Colab

https://colab.research.google.com/drive/161kMwJD1idtF9eeLkRI7GRioMB6vLkka?authuser=0#scrollTo=38_FIBwmTg1S&printMo… 2/2

You might also like