PerGroupStatistic

class lsst.analysis.tools.actions.vector.PerGroupStatistic(*args, **kw)

Bases: VectorAction

Compute per-group statistic values and return result as a vector with one element per group. The computed statistic can be any function accepted by pandas DataFrameGroupBy.aggregate passed in as a string function name.

Attributes Summary

buildAction

Action to build vector (VectorAction, default <class 'lsst.analysis.tools.actions.vector.vectorActions.LoadVector'>)

func

Name of function to be applied per group (str)

groupKey

Column key to use for forming groups (str, default 'obj_index')

Methods Summary

__call__(data, **kwargs)

Call self as a function.

getInputSchema()

Return the schema an AnalysisAction expects to be present in the arguments supplied to the __call__ method.

Attributes Documentation

buildAction

Action to build vector (VectorAction, default <class 'lsst.analysis.tools.actions.vector.vectorActions.LoadVector'>)

func

Name of function to be applied per group (str)

groupKey

Column key to use for forming groups (str, default 'obj_index')

Methods Documentation

__call__(data: MutableMapping[str, ndarray[Any, dtype[ScalarType]] | Scalar | HealSparseMap], **kwargs) ndarray[Any, dtype[ScalarType]]

Call self as a function.

getInputSchema() HealSparseMap]]]

Return the schema an AnalysisAction expects to be present in the arguments supplied to the __call__ method.

Returns:
resultKeyedDataSchema

The schema this action requires to be present when calling this action, keys are unformatted.