Skip to content
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

[FEA] Support aggregates on Decimal columns in cudf Python #7683

Closed
randerzander opened this issue Mar 23, 2021 · 0 comments · Fixed by #7776
Closed

[FEA] Support aggregates on Decimal columns in cudf Python #7683

randerzander opened this issue Mar 23, 2021 · 0 comments · Fixed by #7776
Assignees
Labels
feature request New feature or request Python Affects Python cuDF API.

Comments

@randerzander
Copy link
Contributor

In a recent cudf nightly conda package ('0.19.0a+250.g8632ca0da3'):

Example:

import cudf
from cudf.core.dtypes import Decimal64Dtype

df = cudf.DataFrame({'val': [0.01, 0.02, 0.03], 'id': [0, 1, 2]})

df['dec_val'] = df['val'].astype(Decimal64Dtype(7,2))
df['dec_val'].sum()

Result:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-37-0c210b00ba4f> in <module>
----> 1 df['dec_val'].sum()

/conda/lib/python3.8/site-packages/cudf/core/series.py in sum(self, axis, skipna, dtype, level, numeric_only, min_count, **kwargs)
   4454             )
   4455 
-> 4456         return self._column.sum(
   4457             skipna=skipna, dtype=dtype, min_count=min_count
   4458         )

/conda/lib/python3.8/site-packages/cudf/core/column/column.py in sum(self, skipna, dtype, min_count)
   1275         self, skipna: bool = None, dtype: Dtype = None, min_count: int = 0
   1276     ):
-> 1277         raise TypeError(f"cannot perform sum with type {self.dtype}")
   1278 
   1279     def product(

TypeError: cannot perform sum with type decimal
@randerzander randerzander added bug Something isn't working Python Affects Python cuDF API. labels Mar 23, 2021
@randerzander randerzander changed the title [BUG] Can't perform aggregates along Decimal columns in cudf Python [FEA] Support aggregates on Decimal columns in cudf Python Mar 23, 2021
@randerzander randerzander added feature request New feature or request and removed bug Something isn't working labels Mar 23, 2021
@shwina shwina assigned shwina and ChrisJar and unassigned shwina Mar 24, 2021
@rapids-bot rapids-bot bot closed this as completed in #7776 Apr 1, 2021
rapids-bot bot pushed a commit that referenced this issue Apr 1, 2021
Enables `sum`, `min`, `max`, `product`, and `sum_of_squares` for `DecimalColumn`

Closes #7683

Authors:
  - https://github.com/ChrisJar

Approvers:
  - Michael Wang (https://github.com/isVoid)
  - https://github.com/brandon-b-miller
  - Keith Kraus (https://github.com/kkraus14)

URL: #7776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants