-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Closed
Labels
CategoricalCategorical Data TypeCategorical Data TypeCleanMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolategood first issue
Milestone
Description
We don't allow NaN in the categories anymore, so this block should be unreachable.
pandas/pandas/core/arrays/categorical.py
Lines 1622 to 1628 in 8bfcddc
# Make sure that we also get NA in categories | |
if self.categories.dtype.kind in ['S', 'O', 'f']: | |
if np.nan in self.categories: | |
values = values.copy() | |
nan_pos = np.where(isna(self.categories))[0] | |
# we only have one NA in categories | |
values[values == nan_pos] = -1 |
If anyone wants to remove it and test things out.
jorisvandenbossche
Metadata
Metadata
Assignees
Labels
CategoricalCategorical Data TypeCategorical Data TypeCleanMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolategood first issue