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 4f27380 commit 5003eaaCopy full SHA for 5003eaa
pandas/core/indexing.py
@@ -1094,7 +1094,16 @@ def _getitem_lowerdim(self, tup: tuple):
1094
if com.is_null_slice(new_key):
1095
return section
1096
# This is an elided recursive call to iloc/loc
1097
- return getattr(section, self.name)[new_key]
+ out = getattr(section, self.name)[new_key]
1098
+ # Re-interpret dtype of out.values for loc/iloc[int, list/slice].
1099
+ # GH60600
1100
+ if (
1101
+ i == 0
1102
+ and isinstance(key, int)
1103
+ and isinstance(new_key, (list, slice))
1104
+ ):
1105
+ out = out.infer_objects()
1106
+ return out
1107
1108
raise IndexingError("not applicable")
1109
0 commit comments