Skip to content

REGR: value_counts raises with bins #54884

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

Merged
merged 6 commits into from
Sep 1, 2023
Merged

REGR: value_counts raises with bins #54884

merged 6 commits into from
Sep 1, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Aug 30, 2023

@phofl phofl added Regression Functionality that used to work in a prior pandas version Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff labels Aug 30, 2023
@phofl phofl added this to the 2.1.1 milestone Aug 30, 2023
# GH#54857
values = np.array([3, 1, 2, 3, 4, np.nan])
with tm.assert_produces_warning(FutureWarning, match="deprecated"):
result = pd.value_counts(values, bins=3)
Copy link
Member

@mroeschke mroeschke Aug 31, 2023

Choose a reason for hiding this comment

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

Can we just test the pd.Series(values).values_counts(bins=3) version instead to avoid the futurewarning?

Copy link
Member Author

@phofl phofl Aug 31, 2023

Choose a reason for hiding this comment

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

Edit: Sorry that was wrong, wrong environment, yes can do

# Conflicts:
#	doc/source/whatsnew/v2.1.1.rst
@phofl phofl merged commit 4b31302 into pandas-dev:main Sep 1, 2023
@phofl phofl deleted the 54857 branch September 1, 2023 16:17
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Sep 1, 2023
mroeschke pushed a commit that referenced this pull request Sep 1, 2023
…ns) (#54932)

Backport PR #54884: REGR: value_counts raises with bins

Co-authored-by: Patrick Hoefler <[email protected]>
mroeschke pushed a commit to mroeschke/pandas that referenced this pull request Sep 11, 2023
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 Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

value_counts: TypeError: bins argument only works with numeric data.
2 participants