-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
[WIP] ENH: interval accessor #19502
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
[WIP] ENH: interval accessor #19502
Conversation
@@ -510,6 +510,39 @@ def is_interval_dtype(arr_or_dtype): | |||
return IntervalDtype.is_dtype(arr_or_dtype) | |||
|
|||
|
|||
def is_interval_arraylike(arr): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may not be needed in the long-term; once #19453 is closed is_interval_dtype
should be sufficient anywhere I've used this, so haven't added related tests. Can add tests if this PR looks like it will get closed first. Or is there a reason we'd want to keep this after #19453, in which case tests should be added regardless?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure as part of adding first class dtypes we would want to remove this, but no problem add it here now. you can add a couple of basic test for this though.
Codecov Report
@@ Coverage Diff @@
## master #19502 +/- ##
==========================================
- Coverage 91.67% 91.66% -0.02%
==========================================
Files 148 148
Lines 48553 48610 +57
==========================================
+ Hits 44513 44558 +45
- Misses 4040 4052 +12
Continue to review full report at Codecov.
|
Looks good to me (I wonder if any bits can be put into What do people think about the name |
should be interval i think |
I prefer interval too.
…On Sat, Feb 3, 2018 at 8:58 PM, Jeff Reback ***@***.***> wrote:
should be interval i think
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19502 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIkXG9YrU5vB0Gyhd_nUHNRUDfmttks5tRMiLgaJpZM4R2kjN>
.
|
FWIW my choice of using an abbreviated name was that it seems more consistent with the existing accessor naming conventions; we use |
@@ -510,6 +510,39 @@ def is_interval_dtype(arr_or_dtype): | |||
return IntervalDtype.is_dtype(arr_or_dtype) | |||
|
|||
|
|||
def is_interval_arraylike(arr): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure as part of adding first class dtypes we would want to remove this, but no problem add it here now. you can add a couple of basic test for this though.
@jschendel happy to have this. if you can close for now, or update |
closing as stale for now, happy to have this when you have time @jschendel |
git diff upstream/master -u -- "*.py" | flake8 --diff
Still have a quite a few things to do, but wanted to make sure I'm on the right track, and have this PR in place to motivate any additional issues/PR that need to be done as a prereq for this.
TODO:
IntervalIndex
methods to the accessorIntervalIndex
methods once they've been addedExample usage:
cc @TomAugspurger : thought you'd be interested as this relates to the new extension accessor code