We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98ef110 commit 20cbc5dCopy full SHA for 20cbc5d
pandas/core/indexes/base.py
@@ -5544,7 +5544,13 @@ def _should_fallback_to_positional(self) -> bool:
5544
"""
5545
Should an integer key be treated as positional?
5546
5547
- return self.inferred_type not in ["integer", "mixed-integer"]
+ if is_integer_dtype(self):
5548
+ return False
5549
+ elif is_object_dtype(self):
5550
+ inferred_dtype = lib.infer_dtype(self._values, skipna=False)
5551
+ return inferred_dtype not in ["integer", "mixed-integer"]
5552
+ else:
5553
+ return True
5554
5555
_index_shared_docs[
5556
"get_indexer_non_unique"
0 commit comments