-
Notifications
You must be signed in to change notification settings - Fork 17
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
left_join with by.x and by.y #62
Comments
You need to use See also examples at: |
Doing that returns |
Do you have an example dataset that I can investigate? |
@pwwang I'm sorry, but I'm unfortunately not at liberty to share the datasets. My question was mostly aimed at founding out whether or not, there was something in the documentation I had missed. I will just have to see if I can do it some other way 🙂 Once again I appreciate your insanely quick response time |
No problem at all. You can also play with that notebook on binder to see if it works in your case. |
Thank you for that |
I assume this is solved. If problem still persists, feel free to reopen. |
* 🔧 Add metadata for datasets * 📝 Mention datar-cli in README * 🔊 Send logs to stderr * 📌Pin depedency verions; 🚨 Switch to flake8; * 🔖 0.5.2 * 🔊 Update CHANGELOG * ⚡️ Optimize dplyr.arrange when data are series from the df * 🔧 Update coveragerc * 🐛 Fix #63 * 📝 Update doc for argument `by` for join functions (#62) * 🐛 Fix #65 * 🔖 0.5.3 * 🔥 Remove prints from tests
Hello
So I have some R code that looks like this:
new_df = df1 %>% merge(df2, by.x = "col", by.y = "col2", all.x = TRUE)
I'm trying to merge left with two columns. Both have by.y value (col2) but only df1 have col1 value.
When I try to do it the datar way like this:
new_df = df1 >> left_join(df2, by =["col1", "col2"])
I get the error:
KeyError: 'col1'
Am I doing something wrong? Or is it not possible to do by.x, by.y like in R?
When doing it the pandas way like:
new_df = pd.merge(df1, df2, left_on = "col1", right_on = "col2", how="left")
It returns col2_y and col2_x, which I'm not interested in. This is not a problem in the R code
The text was updated successfully, but these errors were encountered: