code: def _prod(group_idx, a, size, fill_value, dtype=None):
      
      dtype = minimum_dtype_scalar(fill_value, dtype, a)
      ret = np.full(size, fill_value, dtype=dtype)
      if fill_value != 1:
          ret[group_idx] = 1  # product should start from 1
      np.multiply.at(ret, group_idx, a)
      return ret
docs: Same as aggregate_numpy.py