-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
pandas.core.base.DataError: No numeric types to aggregate #34403
New issue
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
Comments
Thanks for the report - to expedite resolution, could you include a reproducible example https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports ? |
I think this should be fixed after #34056 |
Hi @TomAugspurger, thanks for sharing that.. with the below code, sum works fine on a boolean column, but mean() leads to error. |
@ishgupta I just checked to confirm and this does indeed work on master: [ins] In [3]: df = pd.DataFrame({"a": [1] * 50_000 + [2] * 50_000, "b": pd.array([True] * 100_000)})
[ins] In [4]: df.groupby("a").sum()
Out[4]:
b
a
1 50000
2 50000
[ins] In [5]: df.groupby("a").mean()
Out[5]:
b
a
1 True
2 True
[ins] In [6]: pd.__version__
Out[6]: '1.1.0.dev0+1758.g035e1fe83' |
@dsaxton Thank you for taking time out to respond my query. Is it possible for you to guide me, if a stable release of v1.1.0 available on PyPI ? |
Not on PyPI. Nightly wheels are available at
https://anaconda.org/scipy-wheels-nightly/pandas.
It'll be a few weeks before 1.1
…On Fri, Jun 5, 2020 at 12:57 AM Ish Gupta ***@***.***> wrote:
@dsaxton <https://github.com/dsaxton> Thank you for taking time out to
respond my query.
Actually, I am using the latest version of pandas available, which is
1.0.4, and yes, it is older than the development version you're using. :)
Is it possible for you to guide me, if a stable release of v1.1.0
available on PyPI ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#34403 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKAOIQGJ67OOTQWHVP6NX3RVCCK7ANCNFSM4NL5HDWA>
.
|
aggregating a boolean fields doesn't allow averaging the data column in the latest version. Is there a new alternative of doing this for boolean attributes, or it should only be handled by transforming it to a int/float only?
data[ group_fields + [ bool_field ]].groupby( group_fields ).mean() produces the error mentioned in subject.
The text was updated successfully, but these errors were encountered: