Python and NumPy
Convert the greenhouse thermometers
BOTIE
Examples, experiments and workspace controls
Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.
Try your own inputs
Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.
Context for this challenge
Build a Celsius-to-Fahrenheit converter. Multiply each reading by 1.8, then add 32. It must work on every supplied list.
Botie's greenhouse thermometer readings need new units while retaining their greenhouse positions.
Multiply the Celsius array by the degree-size factor, then add the Fahrenheit reference offset to every entry.
Examples and results
- Greenhouse readings in Celsius
- 012
- 118
- 224
- Required result
- 053.6
- 164.4
- 275.2
- Greenhouse readings in Celsius
- 0-10
- 15
- Required result
- 014
- 141
Try a fresh construction
This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.
Stuck? Inspect a worked construction
The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.
Assumptions and test precision
This is a unit conversion, not a fitted prediction rule. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
Checking the thermometer across its range
This check uses the pieces from “Convert every greenhouse reading”.
BOTIE
- Greenhouse readings in Celsius
- 0-40
- 1-5
- 237.5
Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.
Build a construction in the workspace above first. This case will test those pieces.
Which operation changes the size of a degree, which changes the zero point, and what stays aligned throughout?
Array arithmetic can transform every observation while preserving its position and meaning.
This is a unit conversion, not a fitted prediction rule.
Work through the Python challenges →