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?
