Skip to content

ENH: Special type for qcut/cut to enable sorting. #5314

Closed
@jtratner

Description

@jtratner

I recall discussing this before but came up on the mailing list again. Sorting of cut output is always wrong / ugly. I propose creating a str-like that compares with others of the same type as if they were tuples (possibly with nice logic around ranges) - would be facilitated by intro of CategoricalBlock.

Similar to replacing qcut output with this:

def convert_bins_to_tuple(iterable):
    return [(left, right) for elem in iterable for left, right in elem.strip('()[]').split(',')]

Metadata

Metadata

Assignees

Labels

API DesignCategoricalCategorical Data TypeInternalsRelated to non-user accessible pandas implementation

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions