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 11f1500 commit bf4e74dCopy full SHA for bf4e74d
pandas/core/series.py
@@ -916,11 +916,12 @@ def _get_with(self, key):
916
# Note: The key_type == "boolean" case should be caught by the
917
# com.is_bool_indexer check in __getitem__
918
if key_type == "integer":
919
+ # We need to decide whether to treat this as a positional indexer
920
+ # (i.e. self.iloc) or label-based (i.e. self.loc)
921
if self.index.is_integer() or self.index.is_floating():
922
return self.loc[key]
923
elif isinstance(self.index, IntervalIndex):
- indexer = self.index.get_indexer_for(key)
- return self.iloc[indexer]
924
+ return self.loc[key]
925
else:
926
return self.iloc[key]
927
0 commit comments