-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Strictly monotonic #16555
Strictly monotonic #16555
Conversation
assert idx.is_monotonic_increasing | ||
assert not idx.is_strictly_monotonic_increasing | ||
|
||
@pytest.mark.xfail(reason="buggy MultiIndex.is_monotonic_decresaing.") |
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.
e8054d5
to
6e2eb0e
Compare
Fixed an edge case in partial string indexing where we would incorrectly flip the endpoint on a slice, since we checked for monotonicity when we needed strict monotonicity. Closes pandas-dev#16515 xref dask/dask#2389
6e2eb0e
to
dcd38f0
Compare
Codecov Report
@@ Coverage Diff @@
## master #16555 +/- ##
==========================================
+ Coverage 90.75% 90.75% +<.01%
==========================================
Files 161 161
Lines 51074 51078 +4
==========================================
+ Hits 46353 46357 +4
Misses 4721 4721
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #16555 +/- ##
==========================================
+ Coverage 90.75% 90.75% +<.01%
==========================================
Files 161 161
Lines 51074 51078 +4
==========================================
+ Hits 46353 46357 +4
Misses 4721 4721
Continue to review full report at Codecov.
|
Would dask like to use those If we keep public, would put some See also's referring to the other |
lgtm. merge away. |
thanks! |
(cherry picked from commit cab2b6b)
Asking again, as you merged without responding to my comment: is it needed to add this to the public API? It there demand for this attribute? |
I'm slightly in favor of having it public. In terms of cognitive load, this feels like half an additional method, rather than 2 additional methods 😄 Just since these are so similar to But happy hide it if you want. |
Yes, but in tab completion they don't appear together, so I would say it is back to a full additional method in feeling :-) Since it is very easy to do this yourself as you said above (just combine it with |
Perhaps I'm slow, but it took me a day to realize that strictly monotonic = monotonic & unique 😆 PR is at #16576 Let's hide it for now, and if anyone asks for it we can make it public. |
@jorisvandenbossche I thought this was fine. yes its a a convience method. Sure you can do it, but why not. ok with re-hiding it as @TomAugspurger PR. |
(cherry picked from commit cab2b6b)
(cherry picked from commit cab2b6b)
(cherry picked from commit cab2b6b)
Version 0.20.2 * tag 'v0.20.2': (68 commits) RLS: v0.20.2 DOC: Update release.rst DOC: Whatsnew fixups (pandas-dev#16596) ERRR: Raise error in usecols when column doesn't exist but length matches (pandas-dev#16460) BUG: convert numpy strings in index names in HDF pandas-dev#13492 (pandas-dev#16444) PERF: vectorize _interp_limit (pandas-dev#16592) DOC: whatsnew 0.20.2 edits (pandas-dev#16587) API: Make is_strictly_monotonic_* private (pandas-dev#16576) BUG: reimplement MultiIndex.remove_unused_levels (pandas-dev#16565) Strictly monotonic (pandas-dev#16555) ENH: add .ngroup() method to groupby objects (pandas-dev#14026) (pandas-dev#14026) fix linting BUG: Incorrect handling of rolling.cov with offset window (pandas-dev#16244) BUG: select_as_multiple doesn't respect start/stop kwargs GH16209 (pandas-dev#16317) return empty MultiIndex for symmetrical difference on equal MultiIndexes (pandas-dev#16486) BUG: Bug in .resample() and .groupby() when aggregating on integers (pandas-dev#16549) BUG: Fixed tput output on windows (pandas-dev#16496) Strictly monotonic (pandas-dev#16555) BUG: fixed wrong order of ordered labels in pd.cut() BUG: Fixed to_html ignoring index_names parameter ...
Closes #16515
I think this can go in 0.20.2, even though part of it is a (small) enhancement.