-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat: Add bind_rows and bind_cols #411
base: main
Are you sure you want to change the base?
Conversation
Hey--thanks for your PR! I hope it's okay, I added a couple commits for...
Any chance you are interested in trying to implement the last couple pieces? :) It seems like there are just a couple dplyr behaviors left to get most of its bind_rows functionality! I've listed out some of their key features below, and am happy to help with whatever is useful! bind_rows
bind_cols
import pandas as pd
df1 = pd.DataFrame({'x': [0,1]}, index = [0, 1])
df2 = pd.DataFrame({'y': [1, 2]}, index = [1, 2])
# note that this also doesn't work
# pd.concat([df1, df2], axis=1, ignore_index=True)
pd.concat([df1, df2], 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.
Thanks for submitting this! Added some feedback in a comment. I'm still feeling out which dplyr bind_rows behaviors are most useful, and would love to get your feedback on what pieces are most useful to have
Ignore those previous bind_rows commits. It was a long week, and I didn't read the docs you added! 😅 |
✨ there we go! |
Ah, thanks a ton! I'm running the tests, and can take a closer look tonight or tomorrow! I noticed there were a few places (like mutate) where the variable |
Gah crud! That was a mistake on my end. I renamed my "result" variable, and I guess VS Code said "oooh rename this one!" I tend to write my variables as a definition of what they are in my data science work-- for example, a dataframe always starts with |
# Conflicts: # siuba/dply/verbs.py
A very rudimentary implementation of the
dplyr
equivalent.Similar to join, when piping you must specify all involved dataframes.
e.g.:
one >> bind_rows(_, two)
orbind_rows(one, two)