(self, by=None, axis=0, level=None, as_index=True, sort=True,
                              group_keys=True, squeeze=False, observed=False)
return sdc_pandas_series_groupby_impl
Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.groupby

    Limitations
    -----------
    - Parameters ``axis``, ``level``, ``as_index``, ``group_keys``, ``squeeze`` and ``observed`` \
are currently unsupported by Intel Scalable Dataframe Compiler
    - Parameter ``by`` is supported as single literal column name only
    - Mutating the contents of a DataFrame between creating a groupby object and calling it's methods is unsupported

    Examples
    --------
    .. literalinclude:: ../../../examples/series/series_groupby.py
       :language: python
       :lines: 33-
       :caption: Return the mean of the values grouped by numpy array.
       :name: ex_series_groupby

    .. command-output:: python ./series/series_groupby.py
       :cwd: ../../../examples

    .. seealso::

        :ref:`Series.resample <pandas.Series.resample>`
            Resample time-series data.

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************
    Pandas Series method :meth:`pandas.Series.groupby` implementation.

    .. only:: developer
        Test: python -m sdc.runtests sdc.tests.test_groupby.TestGroupBy.test_series_groupby*
Intel Scalable Dataframe Compiler User Guide
    ********************************************
Intel Scalable Dataframe Compiler User Guide ********************************************
def sdc_pandas_series_groupby(self, by=None, axis=0, level=None, as_index=True, sort=True,
                              group_keys=True, squeeze=False, observed=False):
    """
    Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.groupby

    Limitations
    -----------
    - Parameters ``axis``, ``level``, ``as_index``, ``group_keys``, ``squeeze`` and ``observed`` \
are currently unsupported by Intel Scalable Dataframe Compiler
    - Parameter ``by`` is supported as single literal column name only
    - Mutating the contents of a DataFrame between creating a groupby object and calling it's methods is unsupported

    Examples
    --------
    .. literalinclude:: ../../../examples/series/series_groupby.py
       :language: python
       :lines: 33-
       :caption: Return the mean of the values grouped by numpy array.
       :name: ex_series_groupby

    .. command-output:: python ./series/series_groupby.py
       :cwd: ../../../examples

    .. seealso::

        :ref:`Series.resample <pandas.Series.resample>`
            Resample time-series data.

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************
    Pandas Series method :meth:`pandas.Series.groupby` implementation.

    .. only:: developer
        Test: python -m sdc.runtests sdc.tests.test_groupby.TestGroupBy.test_series_groupby*
    """

    _func_name = 'Method Series.groupby().'

    ty_checker = TypeChecker(_func_name)
    ty_checker.check(self, SeriesType)

    # we support only simpliest case of by being 1D array (a column of a DataFrame)
    # TODO: extend and support fully functional SeriesGroupBy
    if not ((isinstance(by, types.Array) and by.ndim == 1)
            or by == string_array_type):
        return None

    if not (isinstance(axis, (types.Integer, types.UnicodeType, types.Omitted)) or axis == 0):
        ty_checker.raise_exc(axis, 'int or str', 'axis')

    if not (level is None or isinstance(level, types.Omitted)):
        raise TypingError('{} Unsupported parameters. Given inplace: {}'.format(_func_name, level))

    if not (as_index is True or isinstance(as_index, types.Omitted)):
        raise TypingError('{} Unsupported parameters. Given inplace: {}'.format(_func_name, as_index))

    if not (isinstance(sort, (types.Omitted, types.Boolean)) or sort is True):
        ty_checker.raise_exc(sort, 'bool', 'sort')

    if not (group_keys is True or isinstance(group_keys, types.Omitted)):
        raise TypingError('{} Unsupported parameters. Given inplace: {}'.format(_func_name, group_keys))

    if not (squeeze is False or isinstance(squeeze, types.Omitted)):
        raise TypingError('{} Unsupported parameters. Given inplace: {}'.format(_func_name, squeeze))

    if not (observed is False or isinstance(observed, types.Omitted)):
        raise TypingError('{} Unsupported parameters. Given inplace: {}'.format(_func_name, observed))

    by_type = by.dtype
    list_type = types.ListType(types.int64)
    def sdc_pandas_series_groupby_impl(self, by=None, axis=0, level=None, as_index=True, sort=True,
                                       group_keys=True, squeeze=False, observed=False):

        if len(self) != len(by):
            raise ValueError("Series.groupby(). Grouper and axis must be same length")

        grouped = Dict.empty(by_type, list_type)
        for i in numpy.arange(len(by)):
            if isna(by, i):
                continue
            value = by[i]
            group_list = grouped.get(value, List.empty_list(types.int64))
            group_list.append(i)
            grouped[value] = group_list

        return init_series_groupby(self, by, grouped, sort)

    return sdc_pandas_series_groupby_impl
def sdc_pandas_series_groupby ( self , by = None , axis = 0 , level = None , as_index = True , sort = True , group_keys = True , squeeze = False , observed = False ) : _func_name = 'Method Series.groupby().' ty_checker = TypeChecker ( _func_name ) ty_checker . check ( self , SeriesType ) # we support only simpliest case of by being 1D array (a column of a DataFrame) # TODO: extend and support fully functional SeriesGroupBy if not ( ( isinstance ( by , types . Array ) and by . ndim == 1 ) or by == string_array_type ) : return None if not ( isinstance ( axis , ( types . Integer , types . UnicodeType , types . Omitted ) ) or axis == 0 ) : ty_checker . raise_exc ( axis , 'int or str' , 'axis' ) if not ( level is None or isinstance ( level , types . Omitted ) ) : raise TypingError ( '{} Unsupported parameters. Given inplace: {}' . format ( _func_name , level ) ) if not ( as_index is True or isinstance ( as_index , types . Omitted ) ) : raise TypingError ( '{} Unsupported parameters. Given inplace: {}' . format ( _func_name , as_index ) ) if not ( isinstance ( sort , ( types . Omitted , types . Boolean ) ) or sort is True ) : ty_checker . raise_exc ( sort , 'bool' , 'sort' ) if not ( group_keys is True or isinstance ( group_keys , types . Omitted ) ) : raise TypingError ( '{} Unsupported parameters. Given inplace: {}' . format ( _func_name , group_keys ) ) if not ( squeeze is False or isinstance ( squeeze , types . Omitted ) ) : raise TypingError ( '{} Unsupported parameters. Given inplace: {}' . format ( _func_name , squeeze ) ) if not ( observed is False or isinstance ( observed , types . Omitted ) ) : raise TypingError ( '{} Unsupported parameters. Given inplace: {}' . format ( _func_name , observed ) ) by_type = by . dtype list_type = types . ListType ( types . int64 ) def sdc_pandas_series_groupby_impl ( self , by = None , axis = 0 , level = None , as_index = True , sort = True , group_keys = True , squeeze = False , observed = False ) : if len ( self ) != len ( by ) : raise ValueError ( "Series.groupby(). Grouper and axis must be same length" ) grouped = Dict . empty ( by_type , list_type ) for i in numpy . arange ( len ( by ) ) : if isna ( by , i ) : continue value = by [ i ] group_list = grouped . get ( value , List . empty_list ( types . int64 ) ) group_list . append ( i ) grouped [ value ] = group_list return init_series_groupby ( self , by , grouped , sort ) return sdc_pandas_series_groupby_impl