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

tests for dots broken for python 3.8 3.9 with "last lambda bin is not empty" #392

Closed
sergpolly opened this issue Oct 1, 2022 · 2 comments
Labels

Comments

@sergpolly
Copy link
Member

this is all due to pandas-dev/pandas#48645

and is already fixed in pandas 1.6.dev

that's where is breaks with pandas 1.5.0:

scored_df.groupby([obs_raw_name, lbins], dropna=False, observed=False)[

if curious check minimal reproducible example:

import numpy as np
import pandas as pd

data = pd.DataFrame({"a":[0,0,0,1,1,2]})
bins  = np.r_[-np.inf,[1,2,3,4],np.inf]
categories = pd.cut(data["a"],bins)
# outputs below should be identical - but they are not with pandas 1.5.0
display(data.groupby(categories,dropna=True).count())
display(data.groupby(categories,dropna=False).count())
@gfudenberg gfudenberg added the bug label Oct 10, 2022
@Phlya
Copy link
Member

Phlya commented Oct 24, 2022

I think the freshly released pandas 1.5.1 has this bugfix included

@gfudenberg
Copy link
Member

gfudenberg commented Oct 24, 2022

with

a = data.groupby(categories,dropna=True).count()
b = data.groupby(categories,dropna=False).count()
a.equals(b)

in 1.5.1 !

gfudenberg added a commit that referenced this issue Oct 24, 2022
attempting to fix as per #392
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants