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

Add method argument to DataFrame.quantile #11957

Merged
merged 13 commits into from
Oct 28, 2022

Conversation

rjzamora
Copy link
Member

@rjzamora rjzamora commented Oct 20, 2022

Description

Adds a method argument to Dataframe.quantile to match pandas behavior. Also deprecates DataFrame.quantiles (with a FutureWarning informing the user of the method argument).

Closes #11572

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@rjzamora rjzamora added feature request New feature or request 2 - In Progress Currently a work in progress improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Oct 20, 2022
@rjzamora rjzamora self-assigned this Oct 20, 2022
@rjzamora rjzamora requested review from a team as code owners October 20, 2022 20:25
@github-actions github-actions bot added the Python Affects Python cuDF API. label Oct 20, 2022
@rjzamora rjzamora removed the improvement Improvement / enhancement to an existing function label Oct 21, 2022
Co-authored-by: Richard (Rick) Zamora <[email protected]>
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I applied a suggested typo fix, otherwise LGTM!

@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Base: 87.40% // Head: 86.89% // Decreases project coverage by -0.51% ⚠️

Coverage data is based on head (4faec13) compared to base (f72c4ce).
Patch has no changes to coverable lines.

❗ Current head 4faec13 differs from pull request most recent head fe9dc78. Consider uploading reports for the commit fe9dc78 to get more accurate results

Additional details and impacted files
@@               Coverage Diff                @@
##           branch-22.12   #11957      +/-   ##
================================================
- Coverage         87.40%   86.89%   -0.52%     
================================================
  Files               133      133              
  Lines             21833    21980     +147     
================================================
+ Hits              19084    19100      +16     
- Misses             2749     2880     +131     
Impacted Files Coverage Δ
python/strings_udf/strings_udf/lowering.py 0.00% <0.00%> (-84.40%) ⬇️
python/strings_udf/strings_udf/_typing.py 81.05% <0.00%> (-14.74%) ⬇️
python/strings_udf/strings_udf/__init__.py 84.31% <0.00%> (-12.57%) ⬇️
python/cudf/cudf/io/text.py 91.66% <0.00%> (-8.34%) ⬇️
python/cudf/cudf/core/_base_index.py 82.20% <0.00%> (-3.35%) ⬇️
python/cudf/cudf/core/column/lists.py 92.78% <0.00%> (-0.97%) ⬇️
python/cudf/cudf/testing/dataset_generator.py 72.83% <0.00%> (-0.42%) ⬇️
python/dask_cudf/dask_cudf/core.py 73.72% <0.00%> (-0.41%) ⬇️
python/dask_cudf/dask_cudf/backends.py 84.90% <0.00%> (-0.37%) ⬇️
python/cudf/cudf/core/tools/datetimes.py 84.19% <0.00%> (-0.31%) ⬇️
... and 24 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@wence- wence- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor quibble: we could go through a public API.

python/cudf/cudf/core/dataframe.py Outdated Show resolved Hide resolved
if q_is_number:
result = result.transpose()
return Series(
data=result._columns[0], index=result.index, name=q
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This produces a slight inconsistency with the other cases in that here the index is a cudf.core.index.StringIndex whereas otherwise it is a pandas.core.indexes.base.Index.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change resolve the inconsistency? Side note that this isn't new code, but I'm certainly happy to fix things while we are making changes anyway.

@rjzamora
Copy link
Member Author

Very minor quibble: we could go through a public API.

Thanks for the review @wence- ! Can you clarify what you would like to see here a bit?

@rjzamora rjzamora added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 2 - In Progress Currently a work in progress labels Oct 28, 2022
@rjzamora
Copy link
Member Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 7620fb1 into rapidsai:branch-22.12 Oct 28, 2022
@rjzamora rjzamora deleted the quantile-method branch October 28, 2022 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge feature request New feature or request non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Add method argument to DataFrame.quantile
5 participants