groupby for pandas Series not working
if you need to groupby series' values:
grouped = a.groupby(a)
or
grouped = a.groupby(lambda x: a[x])
You need to pass a mapping of some kind (could be a dict/function/index)
In [6]: a
Out[6]:
4 1
3 2
2 3
1 4
dtype: int64
In [7]: a.groupby(a.index).sum()
Out[7]:
1 4
2 3
3 2
4 1
dtype: int64
In [3]: a.groupby(lambda x: x % 2 == 0).sum()
Out[3]:
False 6
True 4
dtype: int64