Skip to content

API: remove Grouper.groups #51170

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

Closed
wants to merge 2 commits into from

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@phofl phofl added this to the 2.0 milestone Feb 5, 2023
@phofl phofl added the Groupby label Feb 5, 2023
@@ -387,12 +386,6 @@ def _set_grouper(self, obj: NDFrame, sort: bool = False) -> None:
self.obj = obj # type: ignore[assignment]
self._gpr_index = ax

@final
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah approved to quickly. I have a question:

df = DataFrame({"a": [1, 2, 3], "b": 1})
grper = pd.Grouper(key="a")
x = df.groupby(grper)
grper.groups

This returns the groups right now and wouldn't work anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me this raises AttributeError on main

Copy link
Member

@phofl phofl Feb 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I wasn't on the newest commit, this changed in 385a667

Was this intentional? Should add a whatsnew then, since this is technically user facing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh your right, darn. i guess will have to revert part of #51145 and do that+this as a deprecation

@jbrockmendel jbrockmendel deleted the ref-grouper-groups branch February 5, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants