pecon.stats.mean#
- pecon.stats.mean(x, drop_nan=False)#
Compute the arithmetic mean of a dataset.
The mean is the sum of all observations divided by the number of observations. It provides a measure of the central tendency of the data.
- Parameters:
x (array-like) – Input data.
- Returns:
The mean of the input values.
- Return type:
float
Examples
>>> from pecon import stats >>> x = [2, 4, 6, 8] >>> y = [1, 3, 5, 7] >>> mx = stats.mean(x) >>> my = stats.mean(y) >>> print(f"x mean = {mx} and y mean = {my}") x mean = 5.0 and y mean = 4.0