Closed
Description
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