We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
The text was updated successfully, but these errors were encountered:
dupe if #7001
Sorry, something went wrong.
No branches or pull requests
It appears that the mean aggregate function is inconsistent when operating on boolean values.
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.
The text was updated successfully, but these errors were encountered: