def _group_by_count_distinct_agg(s):
    """The function which will aggregate the result from all the partitions(reduce)
    """
    s = s._selected_obj
    return s.groupby(level=list(range(s.index.nlevels))).sum()
