mean static method
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;
}