The question
Show every attending learner’s score so a small sample is not hidden behind a summary.
df Individual observationsYour inputs
df
One row is one learner’s submission. Use attendance and score availability; missing study hours do not disqualify a score.
Field meanings and units
submission_id- Attendance-submission identifier.
student- Learner label.
group- Comparison group.
hours- Study duration in hours.
score- Assessment score in points.
attended- Whether the learner attended.
date- Calendar date supplied as YYYY-MM-DD text unless the task states it is invalid.
submission_id | student | group | hours | score | attended | date |
|---|---|---|---|---|---|---|
| S001 | Learner 1 | A | 2 | 55 | false | 2026-04-01 |
| S002 | Learner 2 | B | 5 | 78 | true | 2026-04-01 |
| S003 | Learner 3 | A | 3 | 68 | true | 2026-04-02 |
| S004 | Learner 4 | B | 7 | None | true | 2026-04-02 |
| S005 | Learner 5 | A | 4 | 72 | false | 2026-04-03 |
View all 12 rows
submission_id | student | group | hours | score | attended | date |
|---|---|---|---|---|---|---|
| S001 | Learner 1 | A | 2 | 55 | false | 2026-04-01 |
| S002 | Learner 2 | B | 5 | 78 | true | 2026-04-01 |
| S003 | Learner 3 | A | 3 | 68 | true | 2026-04-02 |
| S004 | Learner 4 | B | 7 | None | true | 2026-04-02 |
| S005 | Learner 5 | A | 4 | 72 | false | 2026-04-03 |
| S006 | Learner 6 | B | 6 | 85 | true | 2026-04-03 |
| S007 | Learner 7 | A | 8 | 94 | true | 2026-04-04 |
| S008 | Learner 8 | B | 1 | 49 | true | 2026-04-04 |
| S009 | Learner 9 | A | 2 | 56 | false | 2026-04-05 |
| S010 | Learner 10 | B | 5 | 79 | true | 2026-04-05 |
| S011 | Learner 11 | A | 3 | 69 | true | 2026-04-06 |
| S012 | Learner 12 | B | 7 | 91 | true | 2026-04-06 |
The editable setup in Your Python creates these inputs when you run it.
Show every attending learner’s score so a small sample is not hidden behind a summary.
observationsDataFramefigFigureDeliverables
Make the outputs listed below. Use each name exactly as shown. Then choose Check answer.
Python name key
Teal outlines name table columns. Violet left rules name Python objects. Dotted rules mark syntax, functions and parameters. Use each name exactly as shown.
Words in this task
- eligible
- rows that meet this task’s stated conditions
- Attending learnersOutput
observationsDataFrame- Create
observationswith group and score forattended=True and known score, keeping source order.
- Create
- FigureOutput
figFigure- Create
figshowing every eligible score as a point within its group. - Put groups on the horizontal axis and scores on the vertical axis; modest sideways jitter is optional.
- Add a meaningful title and labels
- Display the figure.
Identify Group and Score on the appropriate axes; extra wording is welcome.
- Create
Data policy Keep all supplied source tables unchanged. Work on separate outputs.
Help Hints & explained solution
Choose the amount of help you need. Opening one hint does not reveal the others.
Hint 1 — Think
Would a single average make the individual observations visible?
Hint 2 — Tools
Boolean selection and sns.stripplot() or Axes.scatter()
Revisit: Combine conditions · Raw points · Finish a chart properly
Hint 3 — Approach
Select the requested learners and show each score at its group position without summarising away observations.
Explained solution
Add these lines below # Your work in the editor. The supplied input setup is already there.
observations = df.loc[df.attended & df.score.notna(), ['group', 'score']]
fig, ax = plt.subplots()
sns.stripplot(
data=observations, x='group', y='score', jitter=False, ax=ax
)
ax.set(title='Attending learner scores', xlabel='Group', ylabel='Score')
fig.tight_layout()
plt.show()View supplied setup
This code is already at the top of the editor.
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Supplied input: df (12 rows)
df = pd.DataFrame(
[
('S001', 'Learner 1', 'A', 2, 55, False, '2026-04-01'),
('S002', 'Learner 2', 'B', 5, 78, True, '2026-04-01'),
('S003', 'Learner 3', 'A', 3, 68, True, '2026-04-02'),
('S004', 'Learner 4', 'B', 7, None, True, '2026-04-02'),
('S005', 'Learner 5', 'A', 4, 72, False, '2026-04-03'),
('S006', 'Learner 6', 'B', 6, 85, True, '2026-04-03'),
('S007', 'Learner 7', 'A', 8, 94, True, '2026-04-04'),
('S008', 'Learner 8', 'B', 1, 49, True, '2026-04-04'),
('S009', 'Learner 9', 'A', 2, 56, False, '2026-04-05'),
('S010', 'Learner 10', 'B', 5, 79, True, '2026-04-05'),
('S011', 'Learner 11', 'A', 3, 69, True, '2026-04-06'),
('S012', 'Learner 12', 'B', 7, 91, True, '2026-04-06'),
],
columns=['submission_id', 'student', 'group', 'hours', 'score', 'attended', 'date'],
)Why these steps exist
- Attendance and a known score define the population. Other missing fields are irrelevant.
- Each mark is one score. Sideways jitter can reduce overlap without changing any score or group.
Another valid approach
Unjittered or modestly jittered points are accepted; the measured score and group membership must not change.