ENH: slicing with decreasing monotonic indexes by shoyer · Pull Request #8680 · pandas-dev/pandas (original) (raw)
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
shoyer changed the title
WIP: slicing with decreasing monotonic indexes ENH: slicing with decreasing monotonic indexes
shoyer added a commit to shoyer/pandas that referenced this pull request
Fixes pandas-dev#7640, pandas-dev#8625
This is a work in progress, but it's far enough along that I'd love to get some feedback.
TODOs (more called out in the code):
- documentation + docstrings
- finish the index methods:
-
get_loc
-
get_indexer
-
slice_locs
-
- comparison operations
- fix
is_monotonic
(pending pandas-dev#8680) - ensure sorting works
- arithmetic operations (not essential for MVP)
- cythonize the bottlenecks:
-
from_breaks
-
_data
-
Interval
?
-
-
MultiIndex
-
Categorical
/cut
- serialization
- lots more tests
Index.is_monotonic will have a performance degradation (still O(n) time) in cases where the Index is decreasing monotonic. If necessary, we could work around this, but I think we can probably get away with this because the fall- back options are much slower and in many cases (e.g., for slice indexing) the next thing we'll want to know is if it's decreasing monotonic, anyways.
see GH7860
also: NaN and NaT imply not monotonic
jreback added a commit that referenced this pull request
ENH: slicing with decreasing monotonic indexes
shoyer deleted the reversed-monotonic-slices branch