Skip to content

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

Merged
MarcoGorelli merged 36 commits intopandas-dev:mainfrom
MarcoGorelli:just-change-value-counts
Feb 1, 2023
Merged

API: various .value_counts() result in different names / indices#49912
MarcoGorelli merged 36 commits intopandas-dev:mainfrom
MarcoGorelli:just-change-value-counts

Conversation

@MarcoGorelli
Copy link
Copy Markdown
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
Comment thread doc/source/whatsnew/v2.0.0.rst Outdated

.. _whatsnew_200.api_breaking.value_counts:

Value counts behaviour change
Copy link
Copy Markdown
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

Comment thread doc/source/whatsnew/v2.0.0.rst Outdated
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
Copy Markdown
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?

Comment thread doc/source/whatsnew/v2.0.0.rst
Comment thread pandas/core/groupby/generic.py Outdated
@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
Copy Markdown
Member Author

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

@MarcoGorelli
Copy link
Copy Markdown
Member Author

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

Copy link
Copy Markdown
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
Copy Markdown
Member Author

cheers - @jbrockmendel any further comments?

Copy link
Copy Markdown
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
Copy Markdown
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