-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
inconsistent name handling in value_counts, part 2 #11579
Comments
Can you show where you think
|
Yes, the three options are all ways to change the current behavior. The second option was intended as a compromise between the first option and the change in #10150. @jreback: That's because |
ok, that seems reasonable then. I think the option 1 is fine (though ok with name= |
closing as this was implemented in #49912 |
I was happy to see in the release notes for 0.17.0 that value_counts no longer discards the series name, but the implementation wasn't what I expected.
0.17.0 gives
which doesn't set the index name.
In my opinion the old series name belongs in the index, not in the series name:
Why:
.groupby().size()
behavespd.DataFrame({'n': series.value_counts(), 'has_duplicates': series.value_counts() > 1})
should really have user_id as an index nameThere are three options:
The first option seems more elegant to me but @sinhrks, who reported #10150, apparently expected result.name to be filled, so perhaps there are use cases where the second option is useful.
The text was updated successfully, but these errors were encountered: