- qspec. nan_helper ( y )[source]
-
A helper to handle
nanvalues, e.g., to interpolate them withy[nans] = numpy.interp(x(nans), x(~nans), y[~nans]).- Parameters:
-
- yarray_like
An array-like value.
- Returns:
-
- (nans, x)tuple[ndarray, Callable]
The mask where
yisnanand a function which returns the nonzero indices of an array.