-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Support observed keyword argument in Categorical.value_counts #44002
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
ENH: Support observed keyword argument in Categorical.value_counts #44002
Conversation
AndrewEckart
commented
Oct 12, 2021
•
edited
Loading
edited
- closes ENH: Add observed keyword to value_counts #43498
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
9cf8f79
to
b4d4558
Compare
@@ -163,6 +163,15 @@ class TestMethods(base.BaseMethodsTests): | |||
def test_value_counts(self, all_data, dropna): | |||
return super().test_value_counts(all_data, dropna) | |||
|
|||
def test_value_counts_observed(self, data): |
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.
Can you add a ref to the GH issue similar to other tests
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.
Done
Thanks for the PR - this will also need a whatsnew since its an API change. |
Think this needs abit of discussion before merging - there are lots of other methods this could be applied to. Doesn't make sense for the API to just support value_counts |
@alimcmaster1 Any specifics? |
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
3211ed8
to
30e0540
Compare
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.
@AndrewEckart if you can merge master and move the note will look
@@ -211,7 +211,7 @@ Other enhancements | |||
- :meth:`.GroupBy.mean` now supports `Numba <http://numba.pydata.org/>`_ execution with the ``engine`` keyword (:issue:`43731`) | |||
- :meth:`Timestamp.isoformat`, now handles the ``timespec`` argument from the base :class:``datetime`` class (:issue:`26131`) | |||
- :meth:`NaT.to_numpy` ``dtype`` argument is now respected, so ``np.timedelta64`` can be returned (:issue:`44460`) | |||
- | |||
- :meth:`Categorical.value_counts` now supports the argument ``observed`` (:issue:`43498`) |
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.
can you move to 1.5
Thanks for the pull request but appears to have gone stale. Additionally, this enhancement may need more discussion in the original issue before proceeding with a PR. Closing but happy to have more discussion in the issue. |