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
However, when a column is Categorical, a groupby on the all-null column behaves unexpected:
df['spam'] =df['spam'].astype('category')
df['spam'] =='spam'# works as expecteddf.groupby('id').first()['spam'] =='spam'# raises TypeError: invalid type comparison
Looks like the groupby converts all types in the group to float64:
In a
DataFrame
without a categorical, the following comparisons work as expected:However, when a column is
Categorical
, agroupby
on the all-null column behaves unexpected:Looks like the groupby converts all types in the group to
float64
:The text was updated successfully, but these errors were encountered: