nispace.utils.utils.nan_detector

nispace.utils.utils.nan_detector(*arrays)[source]

Build a combined 1D NaN mask across one or more arrays sharing dim-0 length.

Plain numpy (no numba). For any array with more than 1 dimension, NaN is reduced across axis=1 (any NaN in the row marks it). This is the pre-masking step used before calling the NaN-intolerant numba functions in stats/coloc.py (pearson, mlr, etc.): callers in core/colocalize.py/core/region_influence.py build parcel_mask = ~nan_detector(X_T, y) and index with it before passing data into those functions.

Parameters:

*arrays (np.ndarray) – One or more arrays with the same length along axis 0.

Returns:

Shape (n,); True where any input array has NaN at that position.

Return type:

np.ndarray of bool