Skip to content

Commit 6133f48

Browse files
committed
BUG: CategoricalIndex.get_indexer issue with NaNs (pandas-dev#45361)
Update: Replaced `np.isnan` with `pandas.core.dtypes.missing.isna`
1 parent 8b3a671 commit 6133f48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/indexes/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3700,8 +3700,8 @@ def get_indexer(
37003700
# belong to some category are changed to NaNs
37013701
# Mask to track actual NaN values compared to inserted NaN values
37023702
try:
3703-
target_nans = np.isnan(target)
3704-
except TypeError as e:
3703+
target_nans = isna(target)
3704+
except NotImplementedError:
37053705
target_nans = False
37063706
target = self._maybe_cast_listlike_indexer(target)
37073707

0 commit comments

Comments
 (0)