Skip to content

Commit 44f2649

Browse files
Backport PR pandas-dev#42089: BUG: RecursionError with CategoricalIndex.get_indexer (pandas-dev#42093)
Co-authored-by: jbrockmendel <[email protected]>
1 parent 2b1d1ff commit 44f2649

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/indexes/base.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3410,7 +3410,9 @@ def get_indexer(
34103410
if is_categorical_dtype(target.dtype):
34113411
# potential fastpath
34123412
# get an indexer for unique categories then propagate to codes via take_nd
3413-
categories_indexer = self.get_indexer(target.categories)
3413+
# Note: calling get_indexer instead of _get_indexer causes
3414+
# RecursionError GH#42088
3415+
categories_indexer = self._get_indexer(target.categories)
34143416
indexer = algos.take_nd(categories_indexer, target.codes, fill_value=-1)
34153417

34163418
if (not self._is_multi and self.hasnans) and target.hasnans:

0 commit comments

Comments
 (0)