-
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
KeyError when joining on index level #1770
Labels
bug
Something isn't working
Comments
Thanks for the reporting, @andyvanyperenAM ! |
Thanks @itholic, I tried the bug fix in your PR and it resolves my issue! |
Nice, @andyvanyperenAM . |
ueshin
pushed a commit
that referenced
this issue
Sep 21, 2020
This should resolve #1770 ```python >>> toy_pd = pd.DataFrame(columns = ['day','item','size'], data = [[5, 0, 500],[5, 0, 550],[5, 1, 1500],[5, 1, 700],[5, 1, 900], ... [6, 0, 400],[6, 0, 300],[6, 0, 600], [6, 1, 800],[6, 1, 200], ... [7, 0, 600],[7, 1, 700],[7, 1, 700], [7, 2, 750],[7, 2, 500]]) >>> toy_ks1 = ks.from_pandas(toy_pd).groupby(['day','item']).agg({'size':'mean'}) >>> toy_ks2 = ks.from_pandas(toy_pd).groupby(['day','item']).agg({'size':'mean'}) >>> toy_ks1.join(toy_ks2, on = ['day','item'], rsuffix='r') size sizer day item 5 1 1033.333333 1033.333333 7 1 700.000000 700.000000 2 625.000000 625.000000 6 1 500.000000 500.000000 7 0 600.000000 600.000000 6 0 433.333333 433.333333 5 0 525.000000 525.000000 ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using the index level (multi-index) as join key, an KeyError is raised.
The multi-index originates for example from a groupby operation in previous steps.
In pandas, it is allowed to join on index keys.
example.
results in the error
Anyone else with this problem? Is it fundamendal or a bug? Possible workarounds in the first case?
Koalas version 1.2.0
OS: Windows 10
python 3.7.6
The text was updated successfully, but these errors were encountered: