Skip to content

Index fallbacks with Intervals #49035

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

Closed
wants to merge 4 commits into from

Conversation

Tiri1992
Copy link

@Tiri1992 Tiri1992 commented Oct 10, 2022

Summary

Looks to fix #27437 where the integer index should fallback to positional. I identified that the private method _should_fallback_to_positional returned the expression return self.dtype.subtype.kind in ["m", "M"] which was missing the numpy.dtype.kind for single integers and floats as expressed here.

However, extending the list with ["i", "f"] caused the character count to exceed 88, hence extracting this out in the previous line and storing as a variable to reference.

Tests are also included which aims to mimic the example given in the issue where the series is constructed with a CategoricalIndex with intervals.

Also, this is my first time contributing to the project so would appreciate feedback 👍

Edit

There are a couple things I need to fix

  • Remove .loc[index] from unittest as this wasn't the desired property
  • Investigate why other tests are failing

@Tiri1992 Tiri1992 closed this Oct 11, 2022
@Tiri1992 Tiri1992 deleted the index-on-series-cut-tests branch October 11, 2022 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indexing on series where index is output from pd.cut
1 participant