Skip to content
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

API: various .value_counts() result in different names / indices #49912

Merged
merged 36 commits into from
Feb 1, 2023

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Nov 25, 2022


screenshot of whatsnewnote:

image

@MarcoGorelli MarcoGorelli changed the title WIP Just change value counts WIP API: various .value_counts() result in different names / indices Nov 25, 2022
@MarcoGorelli MarcoGorelli marked this pull request as ready for review November 25, 2022 22:20
@MarcoGorelli MarcoGorelli changed the title WIP API: various .value_counts() result in different names / indices API: various .value_counts() result in different names / indices Nov 25, 2022
@mroeschke mroeschke added API Design Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff labels Nov 28, 2022
@@ -207,6 +207,44 @@ a supported dtype:

pd.Series(["2016-01-01"], dtype="datetime64[D]")

.. _whatsnew_200.api_breaking.value_counts:

Value counts behaviour change
Copy link
Member

@mroeschke mroeschke Dec 5, 2022

Choose a reason for hiding this comment

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

Something more specific like ``value_counts`` sets the resulting name to ``"count"`` would be good

confusion when resetting the index, and the column names would not correspond with the
column values.
Now, the result name will be ``'count'`` (or ``'proportion'`` if ``normalize=True`` was passed),
and the index will be named after the original object.
Copy link
Member

Choose a reason for hiding this comment

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

Could you add the issue number here?

@MarcoGorelli MarcoGorelli marked this pull request as draft December 18, 2022 09:21
@MarcoGorelli MarcoGorelli marked this pull request as ready for review December 18, 2022 17:13
@MarcoGorelli
Copy link
Member Author

Good point on rename, thanks, sorry for having missed that - have updated

@MarcoGorelli
Copy link
Member Author

gentle ping 😄 do we still want to make this change?

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Sure, LGTM

@MarcoGorelli
Copy link
Member Author

cheers - @jbrockmendel any further comments?

Copy link
Member

@jbrockmendel jbrockmendel left a comment

Choose a reason for hiding this comment

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

LGTM thanks for sticking with this

@MarcoGorelli MarcoGorelli added this to the 2.0 milestone Feb 1, 2023
@MarcoGorelli
Copy link
Member Author

thanks for your reviews, much appreciated!

merging then, before more conflicts come in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff API Design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: various .value_counts() result in different names / indices
3 participants