Diagnose calibration across the wrong dimension

Three pressure sensors each produce readings in three trials. Rows of raw represent sensors A, B and C; columns represent trials. All readings and offsets are in kilopascals.


The intended calibration subtracts 2 kPa from every reading of sensor A, 1 kPa from every reading of sensor B, and 4 kPa from every reading of sensor C. An analyst runs this code:


Python
import numpy as np

raw = np.array([[12.0, 17.0, 24.0],
                [14.0, 21.0, 29.0],
                [18.0, 25.0, 31.0]])
offsets = np.array([2.0, 1.0, 4.0])

corrected = raw - offsets
keep = (corrected >= 16.0) & (corrected < 25.0)
selected = corrected[keep]


Determine how many entries of corrected differ from the intended calibration, how many readings selected actually contains, and the mean of selected. Enter both counts as exact integers and the mean in kPa to one decimal place. Trace the code as written.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More NumPy Questions: