-
Notifications
You must be signed in to change notification settings - Fork 21
Add dataframe.join #238
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 dataframe.join #238
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -897,3 +897,45 @@ def to_array_object(self, dtype: Any) -> Any: | |
understanding that consuming libraries would then use the | ||
``array-api-compat`` package to convert it to a Standard-compliant array. | ||
""" | ||
|
||
def join( | ||
self, | ||
other: DataFrame, | ||
*, | ||
how: Literal['left', 'inner', 'outer'], | ||
on: str | list[str] | None = None, | ||
left_on: str | list[str] | None = None, | ||
right_on: str | list[str] | None = None, | ||
) -> DataFrame: | ||
""" | ||
Join with other dataframe. | ||
|
||
Parameters | ||
---------- | ||
other : DataFrame | ||
Dataframe to join with. | ||
how : str | ||
Kind of join to perform. | ||
Must be one of {'left', 'inner', 'outer'}. | ||
Comment on lines
+916
to
+918
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know right joins can be modeled as left joins with the inputs swapped, but any reason not to support There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
exactly, so if the idea is to make a minimal API, right joins probably aren't needed. have never seem them in practice anyway There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can always add them later without it being a breaking change, so I'm good with not including them until there's clear feedback that they're needed / wanted. |
||
on : str | list[str], optional | ||
Key(s) to use to perform join. | ||
Cannot be used in conjunction with `left_on` or `right_on`. | ||
left_on : str | list[str], optional | ||
Key(s) from `self` to perform `join` on. | ||
If more than one key is given, it must be | ||
the same length as `right_on`. | ||
Cannot be used in conjunction with `on`. | ||
right_on : str | list[str], optional | ||
Key(s) from `other` to perform `join` on. | ||
If more than one key is given, it must be | ||
the same length as `left_on`. | ||
Cannot be used in conjunction with `on`. | ||
|
||
Returns | ||
------- | ||
DataFrame | ||
|
||
Notes | ||
----- | ||
Either `on`, or both `left_on` and `right_on`, must be specified. | ||
""" |
Uh oh!
There was an error while loading. Please reload this page.