Skip to content

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

Closed

Conversation

AndrewEckart
Copy link
Contributor

@AndrewEckart AndrewEckart commented Oct 12, 2021

@AndrewEckart AndrewEckart force-pushed the categorical-value-counts branch from 9cf8f79 to b4d4558 Compare October 12, 2021 19:17
@@ -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):
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@alimcmaster1
Copy link
Member

Thanks for the PR - this will also need a whatsnew since its an API change.

@alimcmaster1
Copy link
Member

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 alimcmaster1 added Enhancement Categorical Categorical Data Type labels Oct 12, 2021
@AndrewEckart
Copy link
Contributor Author

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?

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the Stale label Nov 14, 2021
@AndrewEckart AndrewEckart force-pushed the categorical-value-counts branch from 3211ed8 to 30e0540 Compare November 15, 2021 18:18
Copy link
Contributor

@jreback jreback left a 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`)
Copy link
Contributor

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

@mroeschke
Copy link
Member

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.

@mroeschke mroeschke closed this Feb 22, 2022
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.

ENH: Add observed keyword to value_counts
4 participants