Skip to content

pd.Series.groupby is said to have only optional parameters #8015

Closed
@tknuth

Description

@tknuth
s = pd.Series(x)
m = s.groupby().count() # does not work
m = s.groupby(s.values).count() # works

In https://github.com/pydata/pandas/blob/master/pandas/core/generic.py, by=None should be corrected to just by as None always leads to an error.

   def groupby(self, by=None, axis=0, level=None, as_index=True, sort=True,
            group_keys=True, squeeze=False):

        from pandas.core.groupby import groupby
        axis = self._get_axis_number(axis)
        return groupby(self, by, axis=axis, level=level, as_index=as_index,
            sort=sort, group_keys=group_keys, squeeze=squeeze)

See this http://stackoverflow.com/questions/17929426/groupby-for-pandas-series-not-working

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions