Closed
Description
>>>import pandas as pd
>>> pd.__version__
'0.12.0-660-gec77315'
>>> import numpy as np
>>> np.version.version
'1.7.1'
>>> df = pd.DataFrame({'a': [0, 1, 0, 0], 'b': [0, 1, 0, 0]})
>>> sdf = df.to_sparse(fill_value=0)
>>> df.groupby('a').mean()
b
a
0 0
1 1
>>> sdf.groupby('a').mean()
b
a
1 0
I'm not surpised that the mean for group a == 0
was not returned. It is surprising that the result for group a == 1
was incorrect.