cellxgene_census.experimental.pp.mean_variance
- cellxgene_census.experimental.pp.mean_variance(query: ExperimentAxisQuery, layer: str = 'raw', axis: int = 0, calculate_mean: bool = False, calculate_variance: bool = False, ddof: int = 1, nnz_only: bool = False) DataFrame
Calculate mean and/or variance along the
obsaxis from query results. Calculations are done in an accumulative chunked fashion. For the mean and variance calculations, the total number of elements (N) is, by default, the corresponding dimension size: for column-wise calculations (axis = 0) N is number of rows, for row-wise calculations (axis = 1) N is number of columns. For metrics calculated only on nnz (explicitly stored) values of the sparse matrix, specifynnz_only=True.- Parameters:
query – A
tiledbsoma.ExperimentAxisQuery, specifying theobs/varselection over which mean and variance are calculated.layer – X layer used, e.g.,
"raw".axis – Axis or axes along which the statistics are computed.
calculate_mean – If
Trueit calculates mean, otherwise skips calculation.calculate_variance – If
Trueit calculates variance, otherwise skips calculation.ddof – “Delta Degrees of Freedom”: the divisor used in the calculation for variance is
N - ddof, whereNrepresents the number of elements.nnz_only – If
Truemean and variance will only be calculated over explicitly stored values in the sparse matrix. Defaults toFalse.
- Returns:
pandas.DataFrameindexed by thesoma_joinidand with columnsmean(ifcalculate_mean = True), andvariance(ifcalculate_variance = True).
Lifecycle
experimental