mqr.transforms.

zscore#

mqr.transforms.zscore(data, mean=None, stddev=None)#

Create functions that z-score the given data, per-column.

The returned functions (z or z_inv) can take as input a DataFrame whose columns are a subset of the columns in data, or a Series whose name is one of the columns of data.

Parameters:
datapandas.DataFrame

Data to z-score. Mean and stddev are calculated for each column.

meanfloat or array_like, optional

Mean to subtract from the data. Defaults to the mean of data.

stddevfloat or array_like, optional

Stddev to divide out of the data. Defaults to the population sttdev of data.

Returns:
statspandas.DataFrame

Mean and standard deviation values for each column in data (where columns are the same as in data).

zcallable

A transform from data to its z-scored values.

z_invcallable

A transform from z-scored values to the original space.