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
One gets the same behavior if None is replaced by pd.NA, and similar behavior with np.nan but this is coerced to float. Since the categories can be integers and the Series still hold NA values, it seems to me this shouldn't coerce to object.
ser = pd.Series(pd.Categorical([None], categories=[1, 2, 3]))
print(ser)
# 0 NaN
# dtype: category
# Categories (3, int64): [1, 2, 3]
One gets the same behavior if
None
is replaced bypd.NA
, and similar behavior withnp.nan
but this is coerced to float. Since the categories can be integers and the Series still hold NA values, it seems to me this shouldn't coerce to object.Probably unrelated: #46884
The text was updated successfully, but these errors were encountered: