-
Notifications
You must be signed in to change notification settings - Fork 367
Add axis=1 for concat #1009
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 axis=1 for concat #1009
Conversation
|
Nice! Thanks for working on this! |
|
haven't come up with a nice and robust solution for allowing |
Codecov Report
@@ Coverage Diff @@
## master #1009 +/- ##
=========================================
- Coverage 95.2% 95.1% -0.11%
=========================================
Files 34 34
Lines 6883 6779 -104
=========================================
- Hits 6553 6447 -106
- Misses 330 332 +2
Continue to review full report at Codecov.
|
| new_objs.append(obj) | ||
| objs = new_objs | ||
|
|
||
| if axis == 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.
For ignore_index, I think we can explicitly throw an exception for now when axis is 1.
databricks/koalas/namespace.py
Outdated
| if axis in [0, 'index']: | ||
| axis = 0 | ||
| elif axis in [1, 'columns']: | ||
| axis = 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.
Seems conflict was by 6ece69d
| sdfs = internal._sdf | ||
| continue | ||
| col = '{}'.format(index_col) | ||
| sdfs = sdfs.join(obj._internal._sdf, |
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.
@charlesdong1991, can we do this via each column assignment? It can leverage existing logics for compute.ops_on_diff_frames (see config.py)
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.
Very sorry to wait such long to get back to this PR @HyukjinKwon
I am not sure if i fully understand here, if via each column assignment, doesn't it mean the ops become more expensive? I made a slight change, feel free to review and will appreciate your feedback and suggestions! I got through tough time already, so will have time to make code changes much quicker.
|
Many thanks for your comments @HyukjinKwon I am very sorry that I have been very busy recently and don't have time for my existing PRs. I will try my best to update the PR following your comments this weekend! Thanks again for your understanding and patience! |
|
Hey, @charlesdong1991 no worries at all. Thanks for trying this change out. |
Softagram Impact Report for pull/1009 (head commit: f672805)⭐ Change Overview
📄 Full report
Impact Report explained. Give feedback on this report to [email protected] |
This PR proposes to add `axis` at `ks.concat(...)`. ```python import databricks.koalas as ks df1 = ks.DataFrame([['a', 1], ['b', 2]], columns=['letter', 'number']) df2 = ks.DataFrame([['bird', 'polly'], ['monkey', 'george']], columns=['animal', 'name']) ks.concat([df1, df2], axis=1) ``` ``` letter number animal name 0 a 1 bird polly 1 b 2 monkey george ``` Resolves #625, Closes #1009.

#625