The task and original case
Normalize measurement units before adding two component lengths. The task is a unit dictionary, normalized table and dimensional check. It is deliberately small enough that a reviewer can detect whether your transformation preserves physical meaning.
| Case element | Value or requirement |
|---|---|
| Inputs | Two component lengths 2m and 250cm; calculate their combined length after normalization. |
| Build | A unit dictionary, normalized table and dimensional check. |
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 components measure 2m and 250cm. Store original numeric value and unit in separate columns. Choose meters as the common output unit and define the conversion factor for centimeters as 0.01 meters per centimeter. Apply the factor to each row, retain the factor and calculate the sum only after normalization.
Python's CSV documentation supports preserving separate value and unit fields during import. The conversion rule is an authored dimensional calculation, not something a CSV parser infers. Define accepted unit spellings and reject unknown ones. Keep original records and normalized outputs together so a reader can trace the transformation without reverse-engineering it.
Sources[1]
Check the worked result
The first length remains 2m. The second becomes 250 ×0.01 =2.5m. Combined length is 4.5m. Adding raw numeric values gives 252, which has no coherent shared unit in this input table.
State why addition is meaningful for the exercise: the two components are joined end to end with no overlap. Unit conversion alone would not justify summing lengths describing unrelated objects or alternative measurements of the same object. That relationship is part of the task definition.
Make the failure visible
Change 250cm to 250mm. The conversion factor now becomes 0.001 and the combined length 2.25m. An importer that assumes every non-meter value is centimeters fails this check. Also test a missing unit and an implausible negative length. Retain an exception rather than inventing the unit that gives a convenient total.
Revise it and ask someone to reproduce it
Give a peer the raw table and unit dictionary, then ask them to reproduce 4.5m. For revision two, add a component measured in meters and check that it does not receive a second conversion. Compare original and normalized values after export and re-import to catch lost or changed unit labels.
- Every normalized value retains its original value and unit.
- 250cm converts to 2.5m and the total is 4.5m.
- Unknown units cannot silently enter the combined calculation.
Describe the work accurately
After completing your own version, you could adapt this project bullet: “Created an independent measurement audit with retained units, explicit conversion factors and a dimensionally coherent combined-length calculation.”
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.