-
Notifications
You must be signed in to change notification settings - Fork 358
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
Clean pandas usage in frame.agg #821
Conversation
Codecov Report
@@ Coverage Diff @@
## master #821 +/- ##
==========================================
- Coverage 94.36% 94.36% -0.01%
==========================================
Files 32 32
Lines 5854 5853 -1
==========================================
- Hits 5524 5523 -1
Misses 330 330
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. The code is really simpler.
databricks/koalas/frame.py
Outdated
lambda gpdf: gpdf.drop('level_1', 1).set_index('level_0').transpose() | ||
).reset_index(level=1) | ||
pdf = pdf.drop(columns='level_1') | ||
pdf = kdf.to_pandas().stack(level=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just use .stack()
here? Then I guess we can reuse when supporting multi-index columns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, .stack()
should also work indeed. i was trying to be more explicit. Use .stack()
to facilitate supporting multiindex, will change!
thanks! @ueshin
Softagram Impact Report for pull/821 (head commit: a23fc27)⭐ Change Overview
📄 Full report
Impact Report explained. Give feedback on this report to [email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pending tests.
Thanks! merging. |
Nice! Thanks! |
* upstream/master: Updated the koalas logo in readme.md Adding koalas-logo without label Adding Koalas logo to readme Adding koalas logo Clean pandas usage in frame.agg (databricks#821) Implement Series.aggregate and agg (databricks#816) Raise a more helpful error for duplicated columns in Join (databricks#820)
I came across the
frame.agg
when i read through code base, and based on the inline comment, I think the manipulation using pandas could be simplified a bit IIUC.