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 NamedAgg #911

Merged
merged 3 commits into from
Oct 11, 2019
Merged

Add NamedAgg #911

merged 3 commits into from
Oct 11, 2019

Conversation

charlesdong1991
Copy link
Contributor

@charlesdong1991 charlesdong1991 commented Oct 9, 2019

This is equivalent to nested renaming, so like pandas, we have koalas.NamedAgg now for this:

        >>> aggregated = df.groupby('A').agg(b_max=ks.NamedAgg(column='B', aggfunc='max'))
        >>> aggregated
             b_max
        A
        1        2
        2        4

Resolves #823

@codecov-io
Copy link

codecov-io commented Oct 9, 2019

Codecov Report

Merging #911 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #911      +/-   ##
=========================================
+ Coverage   94.28%   94.3%   +0.01%     
=========================================
  Files          34      34              
  Lines        6265    6355      +90     
=========================================
+ Hits         5907    5993      +86     
- Misses        358     362       +4
Impacted Files Coverage Δ
databricks/koalas/__init__.py 82.92% <100%> (-2.08%) ⬇️
databricks/koalas/groupby.py 91.18% <100%> (+0.04%) ⬆️
databricks/conftest.py 95.74% <0%> (-2.13%) ⬇️
databricks/koalas/generic.py 95.07% <0%> (-0.5%) ⬇️
databricks/koalas/missing/groupby.py 100% <0%> (ø) ⬆️
databricks/koalas/missing/frame.py 100% <0%> (ø) ⬆️
databricks/koalas/missing/series.py 100% <0%> (ø) ⬆️
databricks/koalas/frame.py 95.98% <0%> (+0.04%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a540d8b...3a8c93c. Read the comment docs.

@@ -40,6 +40,7 @@ def assert_pyspark_version():
from databricks.koalas.series import Series
from databricks.koalas.typedef import pandas_wraps
from databricks.koalas.config import get_option, set_option, reset_option, options
from databricks.koalas.groupby import NamedAgg
Copy link
Member

Choose a reason for hiding this comment

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

Can we add it to __all__?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks! added!

@softagram-bot
Copy link

Softagram Impact Report for pull/911 (head commit: 3a8c93c)

⭐ Change Overview

Showing the changed files, dependency changes and the impact - click for full size
(Open in Softagram Desktop for full details)

📄 Full report

Impact Report explained. Give feedback on this report to [email protected]

@HyukjinKwon HyukjinKwon merged commit a7fc8f8 into databricks:master Oct 11, 2019
@HyukjinKwon
Copy link
Member

Thanks @charlesdong1991!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Named Aggregation
4 participants