Skip to content

ENH: IntervalArray.min/max #44746

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

Merged
merged 8 commits into from
Dec 6, 2021

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

@jreback jreback added Enhancement Interval Interval data type labels Dec 4, 2021
@jreback jreback added this to the 1.4 milestone Dec 4, 2021
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a rebase as well

@@ -790,6 +790,36 @@ def argsort(
ascending=ascending, kind=kind, na_position=na_position, **kwargs
)

def min(self, *, axis: int | None = None, skipna: bool = True):
if axis is not None and axis >= self.ndim:
raise ValueError(axis)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case hit in tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with test, also fixes the mypy complaint on master

@jreback
Copy link
Contributor

jreback commented Dec 5, 2021

looks fine, can you merge master and ping on green

@jbrockmendel
Copy link
Member Author

rebased + green-ish (same lint complaints as on master)

if mask.any():
if not skipna:
return self._na_value
return self[~mask].min()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u do

Suggested change
return self[~mask].min()
self = self[~mask]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. follow-up OK?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@jreback jreback merged commit e6f0d1d into pandas-dev:master Dec 6, 2021
@jbrockmendel jbrockmendel deleted the enh-intervalarray-minmax branch December 6, 2021 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Interval Interval data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants