mean static method

double mean(
  1. List<double> data
)

Calculates the mean (average) of a list of numbers.

Implementation

static double mean(List<double> data) {
  if (data.isEmpty) {
    throw ArgumentError('Data list cannot be empty');
  }
  return data.reduce((a, b) => a + b) / data.length;
}