limix.qc.mean_impute¶
-
limix.qc.
mean_impute
(X)[source]¶ Column-wise impute
NaN
values by column mean.It works well with Dask array.
Parameters: X (array_like) – Matrix to have its missing values imputed. Returns: Imputed array. Return type: array_like Examples
>>> from numpy.random import RandomState >>> from numpy import nan, array_str >>> from limix.qc import mean_impute >>> >>> random = RandomState(0) >>> X = random.randn(5, 2) >>> X[0, 0] = nan >>> >>> print(array_str(mean_impute(X), precision=4)) [[ 0.9233 0.4002] [ 0.9787 2.2409] [ 1.8676 -0.9773] [ 0.9501 -0.1514] [-0.1032 0.4106]]