Overview
Purpose
Return the median of a numeric sample after validating that the input is one-dimensional, non-empty, and finite.
Parameters
x: sequence or array containing the data.
Returns
A float with the median of x.
Errors and exceptions
ValueErrorifxis empty.ValueErrorifxis not one-dimensional.ValueErrorifxcontainsNaNvalues or infinities.
Example
from mespy import median
value = median([3.0, 1.0, 2.0])
print(value) # 2.0
Notes
The function delegates all preliminary validation to _as_float_vector.