Python and NumPy

Check the largest recovery error

A small error cannot excuse a large one

Botie recovered a saved temperature array. One unacceptable entry must fail the comparison even if all other entries are very close.

BOTIE

The first recovered reading is within 0.001, but the second differs by 0.01. What should determine whether the array passes?
The inputs we are comparing

Recovered readings

Every entry close

  1. 020.0001
  2. 118.0002

One entry too far

  1. 020.0001
  2. 118.01

Reference readings

Same in both cases

  1. 020
  2. 118

Allowed absolute difference

Same in both cases

0.001
Result for every entry close
1
Choose an explanation to test
A negative reference at the tolerance boundary

This check uses the pieces from “Let the worst recovery error decide”.

BOTIE

The first recovered reading differs from its negative reference by exactly the allowed absolute amount. Predict whether all entries pass the inclusive tolerance check.
Recovered readings
  1. 0-2.5
  2. 10
  3. 25.25
Reference readings
  1. 0-2
  2. 10
  3. 25
Allowed absolute difference
0.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.

Why is maximum the appropriate reducer for 'every entry', and what extra checks would still be needed for incompatible shapes?

Choose a numerical check from its stated contract, including tolerance and boundary behaviour.

Workshop inputs are finite, equally sized vectors. Python adds shape, dtype, missing-value, and relative-tolerance checks.

Work through the Python challenges →
Continue the courseCan We Repeat the Same Experiment? →