Skip to content

Support pad/backfill/nearest reindexing even for unsorted indexes by storing a sorted index? #9510

Closed
@shoyer

Description

@shoyer

Recently, I've been working on adding a 'nearest' method to reindexing: #9258

It occurs to me that we could easily extend reindexing/get_indexer methods to work with unordered indexes if we were willing to do a sort operation on the index if necessary. This would probably entail saving the sorted result on the parent index, similarly to how get_indexer is currently supported on MultiIndex by creating a tuple index internally.

I think this would be a nice usability gain over the current implementation, and not be too surprising. Sorting indexes (once) is pretty fast, for anything up to millions of rows.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementIndexingRelated to indexing on series/frames, not to indexes themselvesPerformanceMemory or execution speed performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions