On this page Main imports

API Reference / mespy.stats_utils

stats_utils.py

stats_utils.py collects the package’s basic descriptive statistics and the internal validators reused by other modules as well.

Main imports

  • External libraries: numpy as np, numpy.typing.ArrayLike, numpy.typing.NDArray

  • Types defined in the module: FloatVector = NDArray[np.float64]

  • Internal helpers: _as_float_vector, _validate_weights

What it exports

What it does

  • convert array-like inputs into one-dimensional float64 vectors

  • catch empty or non-finite inputs

  • optionally handle strictly positive weights

  • compute unweighted and weighted statistics with a uniform interface

Internal relations

The helpers in this module also support other modules. _as_float_vector is imported by plot_utils; fit_utils uses its own fit input validation.

Detailed pages