We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d1b7fc commit b196a09Copy full SHA for b196a09
pandas/core/indexes/base.py
@@ -4238,17 +4238,11 @@ def reindex(
4238
)
4239
elif self._is_multi:
4240
raise ValueError("cannot handle a non-unique multi-index!")
4241
- else:
4242
- if method is not None or limit is not None:
4243
- raise ValueError(
4244
- "cannot reindex a non-unique index "
4245
- "with a method or limit"
4246
- )
4247
- indexer, _ = self.get_indexer_non_unique(target)
4248
-
4249
- if not self.is_unique:
+ elif not self.is_unique:
4250
# GH#42568
4251
raise ValueError("cannot reindex on an axis with duplicate labels")
+ else:
+ indexer, _ = self.get_indexer_non_unique(target)
4252
4253
target = self._wrap_reindex_result(target, indexer, preserve_names)
4254
return target, indexer
0 commit comments