group method

Iterable<double> group(
  1. int n
)

Implementation

Iterable<double> group(int n) sync* {
  double acc = 0;
  int c = 1;
  for (var e in this) {
    acc += e;
    if ((c % n) == 0) {
      yield (acc / n);
      acc = 0;
    }
    c++;
  }
}