The task and original case
Report a mean from observed values while preserving one missing observation. The exercise is a missingness profile and analysis-population note. Replacing an unknown with zero changes the question, even when the resulting average looks easy to explain.
| Case element | Value or requirement |
|---|---|
| Inputs | Observed values 2,4,missing,6,8. |
| Build | A missingness profile with a documented analysis population. |
This is an original invented exercise. It is independent practice, with no employer assessment or open-vacancy claim. Download the inputs, attempt your own result, then open the separate answer key.
Data and worked inputs
Build a result another person can follow
The supplied values are 2,4,missing,6 and 8. Create an observation ID for every row, a numeric value column and an observed/missing status. Calculate the valid-value count separately from total row count. Use only observed numeric values for the declared observed-value mean.
pandas documents missing-value representations and handling. Keep the missing row in the dataset and report its status; excluding it from one calculation does not mean deleting it from the evidence. State that this exercise has no reason for the missing value and no justified imputation model. If you later compare alternative assumptions, label each as a sensitivity scenario.
Sources[1]
Check the worked result
Observed values total 20 across four observations, giving an observed mean of 5. Total records are five, with one missing. Filling the missing entry with zero produces 20 ÷5 =4, a different result that assumes an actual zero where none was supplied.
Show the mean, valid count, missing count and total count together. The result describes the observed subset; it does not establish the mean of an unseen full population or prove that the missing observation is similar to those observed.
Make the failure visible
Change the missing value to an explicit zero. Now all five observations are known and the mean 4 is supported by different evidence. Test a text value such as “not recorded” and ensure it is flagged or mapped under a declared missingness rule rather than silently accepted as numeric. Invalid text and intentional missing values may need distinct statuses.
Revise it and ask someone to reproduce it
Ask a peer to add the formerly unknown value as 10. The complete sum becomes 30 and mean 6. Preserve the original observed mean 5 alongside the resolved result so the change is explained by new evidence. Return to the missingness note and update the valid population rather than overwriting its earlier cutoff.
- Observed mean 5 uses four values and preserves the fifth record.
- Missing, invalid and actual-zero states remain distinct.
- A later resolved value changes both count and result transparently.
Describe the work accurately
After completing your own version, you could adapt this project bullet: “Built an independent missingness report with retained unknown observations, explicit analysis populations and sensitivity to resolved values.”
Use Projects or Independent practice as the heading. Keep the input files, result and revision together. Describe only your own completed work; the invented numbers are model outputs, not employer results or measured business impact.