Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: prohibit non-numeric dtypes in construction of IntervalIndex #19016

Closed
jreback opened this issue Dec 31, 2017 · 4 comments · Fixed by #19022
Closed

API: prohibit non-numeric dtypes in construction of IntervalIndex #19016

jreback opened this issue Dec 31, 2017 · 4 comments · Fixed by #19022
Labels
API Design Dtype Conversions Unexpected or buggy dtype conversions Error Reporting Incorrect or improved errors from pandas Interval Interval data type
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Dec 31, 2017

xref #18997

prohibit construction of non-numeric sub-types for IntervalIndex, e.g. object and categorical. Not clear utility and causes a messy implementation.

@jreback jreback added API Design Difficulty Intermediate Dtype Conversions Unexpected or buggy dtype conversions Error Reporting Incorrect or improved errors from pandas Interval Interval data type labels Dec 31, 2017
@jreback jreback added this to the 0.23.0 milestone Dec 31, 2017
@jreback
Copy link
Contributor Author

jreback commented Dec 31, 2017

cc @zfrenchee
cc @jschendel
@shoyer @TomAugspurger @jorisvandenbossche

@jreback jreback changed the title API: prohibit dtypes in construction of IntervalIndex API: prohibit non-numeric dtypes in construction of IntervalIndex Dec 31, 2017
@jschendel
Copy link
Member

To be clear, do we want to disallow non-numeric dtypes just for IntervalIndex, or for Interval as well?

@jreback
Copy link
Contributor Author

jreback commented Dec 31, 2017

yes

@shoyer
Copy link
Member

shoyer commented Dec 31, 2017

In theory, it makes sense to have string intervals, e.g., the first and last name on each page of a phonebook. But our current IntervalIndex indexing (with the interval tree) does not support efficient lookups for non-numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Dtype Conversions Unexpected or buggy dtype conversions Error Reporting Incorrect or improved errors from pandas Interval Interval data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants