code: def _compute_aggregation(aggregation: str, data: Iterable[Any]):
          
          ComputeStats._raise_check_aggregation(aggregation)
          if aggregation == 'nanfraction':
              return np.sum(np.isnan(data)) / len(data)
          if aggregation == 'nancount':
              return int(np.sum(np.isnan(data)))
          return getattr(np, aggregation)(data)
docs: Compute the specified aggregation on the given data.
  
          :param aggregation: the name of an arbitrary NumPy function (e.g., mean, max, median, nanmean, ...)
                              or one of :py:attr:`EXTRA_AGGREGATIONS`.
          :param data: data to be aggregated
          :raise ValueError: if the specified aggregation is not supported or found in NumPy