@final
def _aggregate_series_pure_python(self, obj: Series, func: Callable) -> npt.NDArray[np.object_]:
    (ids, _, ngroups) = self.group_info
    counts = np.zeros(ngroups, dtype=int)
    result = np.empty(ngroups, dtype='O')
    initialized = False
    splitter = get_splitter(obj, ids, ngroups, axis=0)
    for (i, group) in enumerate(splitter):
        res = func(group)
        res = libreduction.extract_result(res)
        if (not initialized):
            libreduction.check_result_array(res, group.dtype)
            initialized = True
        counts[i] = group.shape[0]
        result[i] = res
    return result
@final
def _aggregate_series_pure_python(self, obj: Series, func: Callable) -> npt.NDArray[np.object_]:
    (ids, _, ngroups) = self.group_info
    counts = np.zeros(ngroups, dtype=int)
    result = np.empty(ngroups, dtype='O')
    initialized = False
    splitter = get_splitter(obj, ids, ngroups, axis=0)
    for (i, group) in enumerate(splitter):
        res = func(group)
        res = libreduction.extract_result(res)
        if (not initialized):
            libreduction.check_result_array(res, group.dtype)
            initialized = True
        counts[i] = group.shape[0]
        result[i] = res
    return result