English

Write the python statements to print average marks in Science by all the students in each UT.

Advertisements
Advertisements

Question

Write the python statements to print average marks in Science by all the students in each UT.

Code Writing
Advertisements

Solution

This code groups the DataFrame according to UT (Unit Test) and calculates the average Science marks of all students in each Unit Test using mean().

print("Average marks in Science by all students in each UT:")
print(df.groupby('UT')['Science'].mean())
shaalaa.com
  Is there an error in this question or solution?
Chapter 3: Data Handling using Pandas - II - Intext Questions [Page 82]

APPEARS IN

NCERT Informatics Practices [English] Class 12
Chapter 3 Data Handling using Pandas - II
Intext Questions | Q 7. | Page 82
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×