Closed
Description
It appears that the mean aggregate function is inconsistent when operating on boolean values.
from pandas import DataFrame
df1 = DataFrame({'a': [1, 1], 'bools': [True, True]})
df2 = DataFrame({'a': [1, 1], 'bools': [True, False]})
print df1.mean().bools # 1.0
print df2.mean().bools # 0.5
print df1.groupby('a').mean() # DataFrame with 1: True
print df2.groupby('a').mean() # DataFrame with 1: 0.5
For some reason the mean of a set of True values is True instead of 1.0, but only for GroupBy objects and not for DataFrame objects.