Question

In: Computer Science

The table below contains various grades for three students obtained over the course of the year....

The table below contains various grades for three students obtained over the course of the year. Assuming that all grades are equally weighted, generate a new table that displays the name of the student, their average grade, and the number of grades they had in their record.

import numpy as np
np.random.seed(seed=0)
Students = ['Samir','Mark','Zoe','Andrew','Rupert']
Grades_Data = []
for i in range(100): 
    Student_Index = np.random.randint(0,len(Students))
    Student = Students[Student_Index]
    Grade = round(np.random.normal(loc=75,scale=15),1)
    Grades_Data.append([Student,Grade])
import pandas as pd
Grades_df = pd.DataFrame(data=Grades_Data,columns=['Student','Grade'])
Grades_df.iloc[0:10]

Solutions

Expert Solution

#CODE TO COPY

import numpy as np
np.random.seed(seed=0)
Students = ['Samir','Mark','Zoe','Andrew','Rupert']
Grades_Data = []
for i in range(100):
Student_Index = np.random.randint(0,len(Students))
Student = Students[Student_Index]
Grade = round(np.random.normal(loc=75,scale=15),1)
Grades_Data.append([Student,Grade])
import pandas as pd
Grades_df = pd.DataFrame(data=Grades_Data,columns=['Student','Grade'])

#To get average and count of each student using groupby

final_df = Grades_df.groupby('Student').agg(["mean","count"]).reset_index()

#To drop aggregrate columns name like mean count

final_df.columns = final_df.columns.droplevel(0)

#To set our own columns

final_df.columns = ['student_name', 'average_grade','number_of_grades']

#Final table

final_df


Related Solutions

During one semester, a student received grades in various subjects, as shown in Table 2 below....
During one semester, a student received grades in various subjects, as shown in Table 2 below. Determine whether there is a significant difference between the student’s grade at the 0.05 level. (15 points) Subject Scores Mathematics 72, 80, 83, 75 Science 81, 74, 77 English 88, 82, 90, 87, 80 Economics 74, 71, 77, 70 This is the complete question. I think an Anova needs to be done to it?
A sample of 10 students was selected from a large statistics course. The grades of the...
A sample of 10 students was selected from a large statistics course. The grades of the 10 students on their test are shown below: 94 61 96 66 92 68 75 85 84 78 3a. Create a histogram, with the first class being 60-69. (3 pts) 3b. Calculate the following for the above data. Please only report the results. (8 pts) Mean = _____ Median = _____ Mode = _____ Range = ____ 3c. Calculate the standard deviation for the...
2.32 The following are the grades that 50 students obtained on an accounting test: 73 65...
2.32 The following are the grades that 50 students obtained on an accounting test: 73 65 82 70 45 50 70 54 32 75 75 67 65 60 75 87 83 40 72 64 58 75 89 70 73 55 61 78 89 93 43 51 59 38 65 71 75 85 65 85 49 97 55 60 76 75 69 35 45 63 Convert the distribution from classes 30-39, 40-49, 50-59, …, and 90-99 into cumulative “less than” distribution,...
An SAT prep course claims to improve the test score of students. The table below shows...
An SAT prep course claims to improve the test score of students. The table below shows the scores for seven students the first two times they took the verbal SAT. Before taking the SAT for the second time, each student took a course to try to improve his or her verbal SAT scores. Do these results support the claim that the SAT prep course improves the students' verbal SAT scores? Let d=(verbal SAT scores prior to taking the prep course)−(verbal...
An SAT prep course claims to improve the test score of students. The table below shows...
An SAT prep course claims to improve the test score of students. The table below shows the scores for seven students the first two times they took the verbal SAT. Before taking the SAT for the second time, each student took a course to try to improve his or her verbal SAT scores. Do these results support the claim that the SAT prep course improves the students' verbal SAT scores? Let d=(verbal SAT scores prior to taking the prep course)−(verbal...
An SAT prep course claims to improve the test score of students. The table below shows...
An SAT prep course claims to improve the test score of students. The table below shows the scores for seven students the first two times they took the verbal SAT. Before taking the SAT for the second time, each student took a course to try to improve his or her verbal SAT scores. Do these results support the claim that the SAT prep course improves the students' verbal SAT scores? Let d=(verbal SAT scores prior to taking the prep course)−(verbal...
An SAT prep course claims to improve the test score of students. The table below shows...
An SAT prep course claims to improve the test score of students. The table below shows the scores for seven students the first two times they took the verbal SAT. Before taking the SAT for the second time, each student took a course to try to improve his or her verbal SAT scores. Do these results support the claim that the SAT prep course improves the students' verbal SAT scores? Let d=(verbal SAT scores prior to taking the prep course)−(verbal...
An SAT prep course claims to improve the test score of students. The table below shows...
An SAT prep course claims to improve the test score of students. The table below shows the scores for seven students the first two times they took the verbal SAT. Before taking the SAT for the second time, each student took a course to try to improve his or her verbal SAT scores. Do these results support the claim that the SAT prep course improves the students' verbal SAT scores? Let d=(verbal SAT scores prior to taking the prep course)−(verbal...
An SAT prep course claims to improve the test score of students. The table below shows...
An SAT prep course claims to improve the test score of students. The table below shows the scores for seven students the first two times they took the verbal SAT. Before taking the SAT for the second time, each student took a course to try to improve his or her verbal SAT scores. Do these results support the claim that the SAT prep course improves the students' verbal SAT scores? Let d=(verbal SAT scores prior to taking the prep course)−(verbal...
An SAT prep course claims to improve the test score of students. The table below shows...
An SAT prep course claims to improve the test score of students. The table below shows the scores for seven students the first two times they took the verbal SAT. Before taking the SAT for the second time, each student took a course to try to improve his or her verbal SAT scores. Do these results support the claim that the SAT prep course improves the students' verbal SAT scores? Let d=(verbal SAT scores prior to taking the prep course)−(verbal...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT