def groupby(self: FrameLike, by: Union[(Any, Tuple, 'Series', List[Union[(Any, Tuple, 'Series')]])], axis: Axis=0, as_index: bool=True, dropna: bool=True) -> 'GroupBy[FrameLike]':
    '\n        Group DataFrame or Series using a Series of columns.\n\n        A groupby operation involves some combination of splitting the\n        object, applying a function, and combining the results. This can be\n        used to group large amounts of data and compute operations on these\n        groups.\n\n        Parameters\n        ----------\n        by : Series, label, or list of labels\n            Used to determine the groups for the groupby.\n            If Series is passed, the Series or dict VALUES\n            will be used to determine the groups. A label or list of\n            labels may be passed to group by the columns in ``self``.\n        axis : int, default 0 or \'index\'\n            Can only be set to 0 at the moment.\n        as_index : bool, default True\n            For aggregated output, return object with group labels as the\n            index. Only relevant for DataFrame input. as_index=False is\n            effectively "SQL-style" grouped output.\n        dropna : bool, default True\n            If True, and if group keys contain NA values,\n            NA values together with row/column will be dropped.\n            If False, NA values will also be treated as the key in groups.\n\n        Returns\n        -------\n        DataFrameGroupBy or SeriesGroupBy\n            Depends on the calling object and returns groupby object that\n            contains information about the groups.\n\n        See Also\n        --------\n        pyspark.pandas.groupby.GroupBy\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({\'Animal\': [\'Falcon\', \'Falcon\',\n        ...                               \'Parrot\', \'Parrot\'],\n        ...                    \'Max Speed\': [380., 370., 24., 26.]},\n        ...                   columns=[\'Animal\', \'Max Speed\'])\n        >>> df\n           Animal  Max Speed\n        0  Falcon      380.0\n        1  Falcon      370.0\n        2  Parrot       24.0\n        3  Parrot       26.0\n\n        >>> df.groupby([\'Animal\']).mean().sort_index()  # doctest: +NORMALIZE_WHITESPACE\n                Max Speed\n        Animal\n        Falcon      375.0\n        Parrot       25.0\n\n        >>> df.groupby([\'Animal\'], as_index=False).mean().sort_values(\'Animal\')\n        ... # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE\n           Animal  Max Speed\n        ...Falcon      375.0\n        ...Parrot       25.0\n\n        We can also choose to include NA in group keys or not by setting dropna parameter,\n        the default setting is True:\n\n        >>> l = [[1, 2, 3], [1, None, 4], [2, 1, 3], [1, 2, 2]]\n        >>> df = ps.DataFrame(l, columns=["a", "b", "c"])\n        >>> df.groupby(by=["b"]).sum().sort_index()  # doctest: +NORMALIZE_WHITESPACE\n             a  c\n        b\n        1.0  2  3\n        2.0  2  5\n\n        >>> df.groupby(by=["b"], dropna=False).sum().sort_index()  # doctest: +NORMALIZE_WHITESPACE\n             a  c\n        b\n        1.0  2  3\n        2.0  2  5\n        NaN  1  4\n        '
    if isinstance(by, ps.DataFrame):
        raise ValueError("Grouper for '{}' not 1-dimensional".format(type(by).__name__))
    elif isinstance(by, ps.Series):
        new_by = [by]
    elif is_name_like_tuple(by):
        if isinstance(self, ps.Series):
            raise KeyError(by)
        new_by = [cast(Tuple, by)]
    elif is_name_like_value(by):
        if isinstance(self, ps.Series):
            raise KeyError(by)
        new_by = [(by,)]
    elif is_list_like(by):
        new_by = []
        for key in by:
            if isinstance(key, ps.DataFrame):
                raise ValueError("Grouper for '{}' not 1-dimensional".format(type(key).__name__))
            elif isinstance(key, ps.Series):
                new_by.append(key)
            elif is_name_like_tuple(key):
                if isinstance(self, ps.Series):
                    raise KeyError(key)
                new_by.append(key)
            elif is_name_like_value(key):
                if isinstance(self, ps.Series):
                    raise KeyError(key)
                new_by.append((key,))
            else:
                raise ValueError("Grouper for '{}' not 1-dimensional".format(type(key).__name__))
    else:
        raise ValueError("Grouper for '{}' not 1-dimensional".format(type(by).__name__))
    if (not len(new_by)):
        raise ValueError('No group keys passed!')
    axis = validate_axis(axis)
    if (axis != 0):
        raise NotImplementedError('axis should be either 0 or "index" currently.')
    return self._build_groupby(by=new_by, as_index=as_index, dropna=dropna)
Group DataFrame or Series using a Series of columns.

A groupby operation involves some combination of splitting the
object, applying a function, and combining the results. This can be
used to group large amounts of data and compute operations on these
groups.

Parameters
----------
by : Series, label, or list of labels
    Used to determine the groups for the groupby.
    If Series is passed, the Series or dict VALUES
    will be used to determine the groups. A label or list of
    labels may be passed to group by the columns in ``self``.
axis : int, default 0 or 'index'
    Can only be set to 0 at the moment.
as_index : bool, default True
    For aggregated output, return object with group labels as the
    index. Only relevant for DataFrame input. as_index=False is
    effectively "SQL-style" grouped output.
dropna : bool, default True
    If True, and if group keys contain NA values,
    NA values together with row/column will be dropped.
    If False, NA values will also be treated as the key in groups.

Returns
-------
DataFrameGroupBy or SeriesGroupBy
    Depends on the calling object and returns groupby object that
    contains information about the groups.

See Also
--------
pyspark.pandas.groupby.GroupBy

Examples
--------
>>> df = ps.DataFrame({'Animal': ['Falcon', 'Falcon',
...                               'Parrot', 'Parrot'],
...                    'Max Speed': [380., 370., 24., 26.]},
...                   columns=['Animal', 'Max Speed'])
>>> df
   Animal  Max Speed
0  Falcon      380.0
1  Falcon      370.0
2  Parrot       24.0
3  Parrot       26.0

>>> df.groupby(['Animal']).mean().sort_index()  # doctest: +NORMALIZE_WHITESPACE
        Max Speed
Animal
Falcon      375.0
Parrot       25.0

>>> df.groupby(['Animal'], as_index=False).mean().sort_values('Animal')
... # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
   Animal  Max Speed
...Falcon      375.0
...Parrot       25.0

We can also choose to include NA in group keys or not by setting dropna parameter,
the default setting is True:

>>> l = [[1, 2, 3], [1, None, 4], [2, 1, 3], [1, 2, 2]]
>>> df = ps.DataFrame(l, columns=["a", "b", "c"])
>>> df.groupby(by=["b"]).sum().sort_index()  # doctest: +NORMALIZE_WHITESPACE
     a  c
b
1.0  2  3
2.0  2  5

>>> df.groupby(by=["b"], dropna=False).sum().sort_index()  # doctest: +NORMALIZE_WHITESPACE
     a  c
b
1.0  2  3
2.0  2  5
NaN  1  4
def groupby(self: FrameLike, by: Union[(Any, Tuple, 'Series', List[Union[(Any, Tuple, 'Series')]])], axis: Axis=0, as_index: bool=True, dropna: bool=True) -> 'GroupBy[FrameLike]':
    '\n        Group DataFrame or Series using a Series of columns.\n\n        A groupby operation involves some combination of splitting the\n        object, applying a function, and combining the results. This can be\n        used to group large amounts of data and compute operations on these\n        groups.\n\n        Parameters\n        ----------\n        by : Series, label, or list of labels\n            Used to determine the groups for the groupby.\n            If Series is passed, the Series or dict VALUES\n            will be used to determine the groups. A label or list of\n            labels may be passed to group by the columns in ``self``.\n        axis : int, default 0 or \'index\'\n            Can only be set to 0 at the moment.\n        as_index : bool, default True\n            For aggregated output, return object with group labels as the\n            index. Only relevant for DataFrame input. as_index=False is\n            effectively "SQL-style" grouped output.\n        dropna : bool, default True\n            If True, and if group keys contain NA values,\n            NA values together with row/column will be dropped.\n            If False, NA values will also be treated as the key in groups.\n\n        Returns\n        -------\n        DataFrameGroupBy or SeriesGroupBy\n            Depends on the calling object and returns groupby object that\n            contains information about the groups.\n\n        See Also\n        --------\n        pyspark.pandas.groupby.GroupBy\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({\'Animal\': [\'Falcon\', \'Falcon\',\n        ...                               \'Parrot\', \'Parrot\'],\n        ...                    \'Max Speed\': [380., 370., 24., 26.]},\n        ...                   columns=[\'Animal\', \'Max Speed\'])\n        >>> df\n           Animal  Max Speed\n        0  Falcon      380.0\n        1  Falcon      370.0\n        2  Parrot       24.0\n        3  Parrot       26.0\n\n        >>> df.groupby([\'Animal\']).mean().sort_index()  # doctest: +NORMALIZE_WHITESPACE\n                Max Speed\n        Animal\n        Falcon      375.0\n        Parrot       25.0\n\n        >>> df.groupby([\'Animal\'], as_index=False).mean().sort_values(\'Animal\')\n        ... # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE\n           Animal  Max Speed\n        ...Falcon      375.0\n        ...Parrot       25.0\n\n        We can also choose to include NA in group keys or not by setting dropna parameter,\n        the default setting is True:\n\n        >>> l = [[1, 2, 3], [1, None, 4], [2, 1, 3], [1, 2, 2]]\n        >>> df = ps.DataFrame(l, columns=["a", "b", "c"])\n        >>> df.groupby(by=["b"]).sum().sort_index()  # doctest: +NORMALIZE_WHITESPACE\n             a  c\n        b\n        1.0  2  3\n        2.0  2  5\n\n        >>> df.groupby(by=["b"], dropna=False).sum().sort_index()  # doctest: +NORMALIZE_WHITESPACE\n             a  c\n        b\n        1.0  2  3\n        2.0  2  5\n        NaN  1  4\n        '
    if isinstance(by, ps.DataFrame):
        raise ValueError("Grouper for '{}' not 1-dimensional".format(type(by).__name__))
    elif isinstance(by, ps.Series):
        new_by = [by]
    elif is_name_like_tuple(by):
        if isinstance(self, ps.Series):
            raise KeyError(by)
        new_by = [cast(Tuple, by)]
    elif is_name_like_value(by):
        if isinstance(self, ps.Series):
            raise KeyError(by)
        new_by = [(by,)]
    elif is_list_like(by):
        new_by = []
        for key in by:
            if isinstance(key, ps.DataFrame):
                raise ValueError("Grouper for '{}' not 1-dimensional".format(type(key).__name__))
            elif isinstance(key, ps.Series):
                new_by.append(key)
            elif is_name_like_tuple(key):
                if isinstance(self, ps.Series):
                    raise KeyError(key)
                new_by.append(key)
            elif is_name_like_value(key):
                if isinstance(self, ps.Series):
                    raise KeyError(key)
                new_by.append((key,))
            else:
                raise ValueError("Grouper for '{}' not 1-dimensional".format(type(key).__name__))
    else:
        raise ValueError("Grouper for '{}' not 1-dimensional".format(type(by).__name__))
    if (not len(new_by)):
        raise ValueError('No group keys passed!')
    axis = validate_axis(axis)
    if (axis != 0):
        raise NotImplementedError('axis should be either 0 or "index" currently.')
    return self._build_groupby(by=new_by, as_index=as_index, dropna=dropna)