LINK TO FILES: https://drive.google.com/file/d/1DIueBJcGERFJaGDOlMrjn_kCgnV3K6xc/view?usp=sharing Q3. You are given 30 s
Posted: Sat May 14, 2022 4:40 pm
LINK TO
FILES:
Q3. You are given 30 student files inside the folder
(Student.zip). Unzip the folder to extract the student files. Each
file contains scores of students in 7 different courses (first
column = course title, second column = total grade in the course).
You can assume that no course is taken twice by a student. [35
points: 10+10+5+5+5]
• Use a for loop and read the files in the folder and store them
in a single data frame where the first column is the course name,
second column is the course score and the third column is the
student name (simply use the file name without the “.csv” extension
as the student name). This data frame should have 210 rows.
• Add a fourth a column “lettergrade” to the data frame which
indicates the letter grade of the student in that course using the
following criteria on the course score: A: >=90, B: >=80 and
=70 and < 80, D: >=60 and < 70, otherwise F
For example, the first few rows of the data frame will look like
this:
For example, the first few rows of the data frame will look like this: course score studentname lettergrade 1 CS1410 92 student1 А 2 CS2410 80 student1 B 3 CS3300 91 student1 A 4 CS2304 85 student1 B 5 CS4311 96 studenti A 6 CS4302 91 studenti A 7 CS1311 81 studenti B 8 CS1410 84 student10 B 9 CS2410 91 student10 A 10 CS3300 91 student10 A Next, perform the following tasks • Find the average score in each course. The resulting data frame is: course average 1 CS1311 85.1 2 CS1410 85.8 3 CS2304 84.2 4 CS2410 86.5 5 CS3300 85.4 6 CS4302 86.1 7 CS4311 88.4 For each student, find the average score. First few rows of the data frame is given below: studentname average 1 studenti 88 2 student10 91.9 3 student11 85.6
4 student12 89.3 5 student13 83.6 6 student14 84.9 7 student15 88.1 8 student16 83.6 9 student17 84.4 10 student18 88 • In each course, find out how many students received each of the letter grade. First Few rows of the resulting data frame are shown below: lettergrade course numstudents 1 A CS1311 9 2 A CS1410 11 ЗА CS2304 11 4A CS2410 13 5A CS3300 12 6A CS4302 12 CS4311 17 8B CS1311 9B CS1410 10 B CS2304 8 # ... with 11 more rows 7A 12 14
FILES:
Q3. You are given 30 student files inside the folder
(Student.zip). Unzip the folder to extract the student files. Each
file contains scores of students in 7 different courses (first
column = course title, second column = total grade in the course).
You can assume that no course is taken twice by a student. [35
points: 10+10+5+5+5]
• Use a for loop and read the files in the folder and store them
in a single data frame where the first column is the course name,
second column is the course score and the third column is the
student name (simply use the file name without the “.csv” extension
as the student name). This data frame should have 210 rows.
• Add a fourth a column “lettergrade” to the data frame which
indicates the letter grade of the student in that course using the
following criteria on the course score: A: >=90, B: >=80 and
=70 and < 80, D: >=60 and < 70, otherwise F
For example, the first few rows of the data frame will look like
this:
For example, the first few rows of the data frame will look like this: course score studentname lettergrade 1 CS1410 92 student1 А 2 CS2410 80 student1 B 3 CS3300 91 student1 A 4 CS2304 85 student1 B 5 CS4311 96 studenti A 6 CS4302 91 studenti A 7 CS1311 81 studenti B 8 CS1410 84 student10 B 9 CS2410 91 student10 A 10 CS3300 91 student10 A Next, perform the following tasks • Find the average score in each course. The resulting data frame is: course average 1 CS1311 85.1 2 CS1410 85.8 3 CS2304 84.2 4 CS2410 86.5 5 CS3300 85.4 6 CS4302 86.1 7 CS4311 88.4 For each student, find the average score. First few rows of the data frame is given below: studentname average 1 studenti 88 2 student10 91.9 3 student11 85.6
4 student12 89.3 5 student13 83.6 6 student14 84.9 7 student15 88.1 8 student16 83.6 9 student17 84.4 10 student18 88 • In each course, find out how many students received each of the letter grade. First Few rows of the resulting data frame are shown below: lettergrade course numstudents 1 A CS1311 9 2 A CS1410 11 ЗА CS2304 11 4A CS2410 13 5A CS3300 12 6A CS4302 12 CS4311 17 8B CS1311 9B CS1410 10 B CS2304 8 # ... with 11 more rows 7A 12 14