Counting overlapping points in a scatter plot
Write code · Medium · §5.2 Scatter plots and groups
If you draw a scatter plot of the study hours (hours) and quiz scores (score, out of 10) of 12 students, the points of students with the same coordinates overlap and look like one point. You cannot count them in the chart, so count them in the DataFrame.
Print the number of students (the number of rows) on the first line and the number of distinct coordinates (pairs of hours and score) on the second line. Print only the numbers.
Starter code
import pandas as pd
quiz = pd.DataFrame({
"student": ["S01", "S02", "S03", "S04", "S05", "S06", "S07", "S08", "S09", "S10", "S11", "S12"],
"hours": [2, 3, 3, 5, 2, 4, 3, 5, 1, 4, 3, 2],
"score": [6, 7, 7, 9, 6, 8, 7, 9, 5, 7, 7, 6],
})
# Write your code hereSolve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.