(pairs, dtype="f8", axis=None, computing_meta=False, **kwargs)
| 368 | |
| 369 | |
| 370 | def mean_agg(pairs, dtype="f8", axis=None, computing_meta=False, **kwargs): |
| 371 | ns = deepmap(lambda pair: pair["n"], pairs) if not computing_meta else pairs |
| 372 | n = _concatenate2(ns, axes=axis) |
| 373 | n = np.sum(n, axis=axis, dtype=dtype, **kwargs) |
| 374 | |
| 375 | if computing_meta: |
| 376 | return n |
| 377 | |
| 378 | totals = deepmap(lambda pair: pair["total"], pairs) |
| 379 | total = _concatenate2(totals, axes=axis).sum(axis=axis, dtype=dtype, **kwargs) |
| 380 | |
| 381 | with np.errstate(divide="ignore", invalid="ignore"): |
| 382 | return divide(total, n, dtype=dtype) |
| 383 | |
| 384 | |
| 385 | @derived_from(np) |
nothing calls this directly
no test coverage detected
searching dependent graphs…