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

pandas 1.4.0 release causes a small error #358

Closed
fealho opened this issue Jan 25, 2022 · 0 comments · Fixed by #359
Closed

pandas 1.4.0 release causes a small error #358

fealho opened this issue Jan 25, 2022 · 0 comments · Fixed by #359
Assignees
Labels
maintenance Task related to infrastructure & dependencies
Milestone

Comments

@fealho
Copy link
Member

fealho commented Jan 25, 2022

The new pandas release no longer coerces null-like values in value_counts and mode to a NaN value. This change causes an error in the following test:

def test__get_intervals_nans(self):

That happens because the test assumes both None and np.nan will be treated the same way. However, the categorical transformer uses value_counts, which no longer has that behaviour.

frequencies = data.value_counts(dropna=False)

This error can be fixed by simply converting the None to a np.nan in the following line:

data = pd.Series(['foo', np.nan, None, 'foo', 'foo', 'tar'])

Note: This issue only shows up on python 3.8. Neither py3.7 nor py3.9 cause this to happen, and I have no clue why.

@fealho fealho added the maintenance Task related to infrastructure & dependencies label Jan 25, 2022
@amontanez24 amontanez24 added this to the 0.6.3 milestone Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Task related to infrastructure & dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants