Logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec.average  (  a std = None cov = None axis = None  )[source]

Parameters:
aarray_like

The sample data.

stdarray_like | None

An array of standard deviations associated with the values in a. If specified, the weighted average of the uncorrelated sample data and its standard error is returned.

covscalar_nd | None

The covariance matrix associated with the values in a. If specified, it overrides std and the weighted average of the correlated sample data and its standard error is returned. If no axis is specified, cov must have shape (a.size, a.size) with elements associated with the values in the flattened a, otherwise cov must have either shape (a.shape[axis], a.shape[axis]) or (..., a.shape[axis - 1], a.shape[axis], a.shape[axis], a.shape[axis + 1], ...).

axisint_like | None

The axis along which the average is computed.

Returns:
outtuple[ndarray, ndarray]

The average and its standard error for a given sample a along the specified axis.

API navigation