You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lets suppose aggregate function returns int or float. Then if it returns only 0 and 1 then result is converted to BooleanArray. Otherwise, it returns int or float arrays (as expected).
This is because this code is preserving type if series values is not a subclass of np.ndarray type. And BooleanArray is not.
Hi, I'm a student in a University of Michigan Software Engineering course tasked with fixing a bug in the next couple weeks. My partner, @longovin and I would like to fix this issue!
Lets suppose aggregate function returns int or float. Then if it returns only 0 and 1 then result is converted to BooleanArray. Otherwise, it returns int or float arrays (as expected).
This is because this code is preserving type if series values is not a subclass of np.ndarray type. And BooleanArray is not.
pandas/pandas/core/groupby/ops.py
Line 917 in b552dc9
So then the code tries to preserve type if it can.
Code to reproduce
prints boolean.
If we change values in array
then it prints float64.
If dtype is "bool" (not "boolean"), then groupby always returns expected float result.
prints float64
The text was updated successfully, but these errors were encountered: