OMinMax

class omoment.OMinMax(min: Number = inf, max: Number = -inf, n: int = 0, handling_invalid: HandlingInvalid = HandlingInvalid.Drop)

Bases: OBase

Only estimator for minimum, maximum and number of points.

Not really moments, but it is useful and shares the same interface. Does not use weights.

classmethod compute(x: Number | ndarray | Series, handling_invalid: HandlingInvalid = HandlingInvalid.Drop) OMinMax

Shortcut for initialization of an empty object and its update based on data.

static get_max(omm: OMinMax)

Convenience method to get the maximum value.

static get_min(omm: OMinMax)

Convenience method to get the minimum value.

static get_n(omm: OMinMax)

Convenience method to get the number of points.

max
min
n
classmethod of_frame(data: DataFrame, x: str, handling_invalid: HandlingInvalid = HandlingInvalid.Drop) OMinMax

Create an OMinMax based on a dataframe and a column name.

static of_groupby(data: pd.DataFrame, g: str | List[str], x: str, handling_invalid: HandlingInvalid = HandlingInvalid.Drop) pd.Series[OMinMax]

Optimized version of OMinMax for large number of groups in data (so avoids costly df.groupby -> apply).

update(x: Number | ndarray | Series, handling_invalid: HandlingInvalid = HandlingInvalid.Drop) OMinMax

Update the values based on new data, provided either as a single number or an array-like object.