(x, axis=None)
return means
Equivalent of np.nanmean that supports sparse or dense matrices.
Equivalent of np.nanmean that supports sparse or dense matrices.
Equivalent of np . nanmean that supports sparse or dense matrices .
def nanmean(x, axis=None):
    """ Equivalent of np.nanmean that supports sparse or dense matrices. """
    if not sp.issparse(x):
        means = bn.nanmean(x, axis=axis)
    elif axis is None:
        means, _ = mean_variance_axis(x, axis=0)
        means = np.nanmean(means)
    else:
        means, _ = mean_variance_axis(x, axis=axis)

    return means
def nanmean ( x , axis = None ) : if not sp . issparse ( x ) : means = bn . nanmean ( x , axis = axis ) elif axis is None : means , _ = mean_variance_axis ( x , axis = 0 ) means = np . nanmean ( means ) else : means , _ = mean_variance_axis ( x , axis = axis ) return means