-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: removed deprecated argument obj
from GroupBy get_group
#57136
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
Changes from 2 commits
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 |
---|---|---|
|
@@ -1062,15 +1062,14 @@ def get_group(self, name, obj=None) -> DataFrame | Series: | |
it is None, the object groupby was called on will | ||
be used. | ||
|
||
.. deprecated:: 2.1.0 | ||
The obj is deprecated and will be removed in a future version. | ||
Do ``df.iloc[gb.indices.get(name)]`` | ||
instead of ``gb.get_group(name, obj=df)``. | ||
|
||
Returns | ||
------- | ||
same type as obj | ||
|
||
Raises | ||
------ | ||
ValueError : The passed argument obj is not None. | ||
|
||
Examples | ||
-------- | ||
|
||
|
@@ -1146,14 +1145,7 @@ def get_group(self, name, obj=None) -> DataFrame | Series: | |
indexer = inds if self.axis == 0 else (slice(None), inds) | ||
return self._selected_obj.iloc[indexer] | ||
else: | ||
warnings.warn( | ||
"obj is deprecated and will be removed in a future version. " | ||
"Do ``df.iloc[gb.indices.get(name)]`` " | ||
"instead of ``gb.get_group(name, obj=df)``.", | ||
FutureWarning, | ||
stacklevel=find_stack_level(), | ||
) | ||
return obj._take_with_is_copy(inds, axis=self.axis) | ||
raise ValueError("cannot pass argument obj to get_group") | ||
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. Sorry if I missed any conversations on this but I am fairly certain you can just remove the 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. Agreed 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. thank you, I removed the parameter |
||
|
||
@final | ||
def __iter__(self) -> Iterator[tuple[Hashable, NDFrameT]]: | ||
|
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.
In order to resolve a link to the documentation, can you replace the end with
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.
thank you, I corrected the note in v3.0.0.rst