scdrs.pp._get_mean_var#

scdrs.pp._get_mean_var(sparse_X, axis=0, weights=None)[source]#

Compute mean and var of a sparse / non-sparse matrix.

Parameters:
sparse_Xarray_like

Data matrix (can be dense/sparse).

axis{0, 1}, default=0

Axis along which to compute mean and variance.

weightsarray_like, default=None

Weights of length sparse_X.shape[axis].

Returns:
v_meannp.ndarray

Mean vector.

v_varnp.ndarray

Variance vector.