Python and NumPy
Retrieve the requested mornings
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
Gather the requested day rows, then swap rows and columns so each output row follows one greenhouse through those requested days.
Botie's requested day list is a sequence of requests. Repeating a day is meaningful and must survive selection.
Gather day rows using the supplied indices, including repeats, then transpose the selected table.
Examples and results
- Days by greenhouse
10 20 30 14 22 36 16 24 38 - Requested day indices
- 02
- 10
- Required result
16 10 24 20 38 30
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
These workshop wires carry values rather than shared NumPy storage. Copy and view behaviour is demonstrated and checked in Python. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
Request the last day twice
This check uses the pieces from “Follow each greenhouse through requested days”.
BOTIE
- Days by greenhouse
7 8 10 12 13 16 15 20 - Requested day indices
- 03
- 11
- 23
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.
What information would be lost if the requested indices were sorted or deduplicated before gathering?
An index list carries order and multiplicity, both of which can matter in later resampling.
These workshop wires carry values rather than shared NumPy storage. Copy and view behaviour is demonstrated and checked in Python.
Work through the Python challenges →