I have the task Scatter plot of mark versus test mark (take
#2)
I am unsure how to write this code
Scatter plot of exam mark versus test mark (take #2) This question is identical to the earlier one except for the function name and with one important exception: any data points in which either the test mark or the exam mark is zero should not be plotted. The file marks.csv contains students' marks from COSC131 in some year. It begins Modules, Assignments, Test, Exam 96.43,93.81, 81.36,83.2 23.2, 18.8, 0,62.8 61.16,24.83,54.55,35.2 97.24,99.76,67.73, 87.2 90.6,72.8,58.64,32 48.39,20.9,77.27,69 64.23, 29.1, 49.55,0 98.3,97.93,90.45, 86.8 94.69,93.04,81.82,75.6 96.62,94.05,77.27,83.2 73.4,62.8,72.27,66.4 95.83,95.57,85.91, 87.6 82.26,46.21,67.73,54.4 90.12,99.73, 99.55,99.6 16.94, 16.93, 22.27,62.8 73.72,52.2,62.27,56 Write a function plot_exam_versus_test_no_zeros(filename) that takes such a file and generates a scatter plot of exam marks versus test marks, leaving out any points in which either the exam mark or the test mark is zero. With the given marks file, the plot should look exactly like the following:
COSC131: Exam versus Test 100 80 60 Exam 40 20 0 20 40 60 80 100 Test Notes: You are required to use the standard numpy plot function with markers (green circles of the default size) and no lines. Do not use the numpy scatter function, which is in general less efficient and should be used only when you have a mixture of marker sizes and/or shapes in the same data set. • You are not allowed to use any loops, list comprehensions, or if statements in the function. • Your plot should have the title "COSC131: Exam versus Test", x-label "Test", and y-label "Exam". • You are allowed to make only one call to np. loadtxt. Answer:
I have the task Scatter plot of mark versus test mark (take #2) I am unsure how to write this code
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
I have the task Scatter plot of mark versus test mark (take #2) I am unsure how to write this code
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!