-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
These can probably all be removed / simplified now that we don't allow NaN in the categories.
pandas/pandas/core/arrays/categorical.py
Line 1353 in 38afa93
obj = (self.remove_categories([np.nan]) if dropna and pandas/pandas/core/arrays/categorical.py
Line 1326 in 38afa93
if isna(result.categories).any(): pandas/pandas/core/arrays/categorical.py
Line 1279 in 38afa93
if np.nan in self.categories: pandas/pandas/core/arrays/categorical.py
Lines 1892 to 1898 in 38afa93
# FIXME: the following can be removed after GH7820 is fixed: # https://github.com/pandas-dev/pandas/issues/7820 # float categories do currently return -1 for np.nan, even if np.nan is # included in the index -> "repair" this here if isna(rvalue).any() and isna(self.categories).any(): nan_pos = np.where(isna(self.categories))[0] lindexer[lindexer == -1] = nan_pos
Maybe some others if people want to look.
xref #19787
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