API: series_with_int64index[i:j] should be label-based #45162
Labels
API - Consistency
Internal Consistency of API/Behavior
Indexing
Related to indexing on series/frames, not to indexes themselves
Needs Discussion
Requires discussion from core team before further action
Milestone
When we have a Int64Index, series[i] is treated as label-based. For consistency, series[i:j] should be too.
The logic by which
ser[i:j]
is positional is not easy to track down and does not use modern idioms (i.e. _should_fallback_to_positional)NumericIndex._convert_slice_indexer specifically special-cases floating dtypes
while the base class ...
AFAICT the
is_positional = is_index_slice and not (self.is_integer() or self.is_categorical())
check should beis_positional = is_index_slice and self._should_fallback_to_positional
. Theif self.is_integer() or is_index_slice:
should probably also be done in terms of _should_fallback_to_positionalExpected Behavior
The text was updated successfully, but these errors were encountered: