Python and NumPy
Find the greenhouse alerts
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 mask using the threshold, then use it to select the original readings. Preserve their order and allow an empty result.
Botie wants the original temperatures that meet an alert rule. The yes-or-no comparisons are only an intermediate result.
Compare readings with the inclusive limit, then use the resulting mask to select entries from the original readings.
Examples and results
- Greenhouse temperatures
- 020
- 127
- 225
- 318
- Alert temperature
25
- Required result
- 027
- 125
- Greenhouse temperatures
- 023
- 120
- 224
- 322
- Alert temperature
22
- Required result
- 023
- 124
- 222
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
The limit is supplied by the task. It is not a learned or medically meaningful threshold. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
Two houses exactly at the alert limit
This check uses the pieces from “Use decisions to select measurements”.
BOTIE
- Greenhouse temperatures
- 024
- 125
- 225
- 327
- Alert temperature
25
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.
Why do the mask and the selected temperatures need separate wires, and why does equality with the limit count here?
A Boolean decision array can select aligned values; an empty selection should remain valid when nothing matches.
The limit is supplied by the task. It is not a learned or medically meaningful threshold.
Work through the Python challenges →