-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
API: change Index set ops sort=True -> sort=None #25063
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
TomAugspurger
merged 24 commits into
pandas-dev:master
from
jorisvandenbossche:TomAugspurger-24959-union-default_0241
Feb 1, 2019
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
aac172c
[WIP]: API: Change default for Index.union sort
TomAugspurger d4bcc55
update test
TomAugspurger 45c827c
fixups
TomAugspurger 68b72a6
Merge remote-tracking branch 'upstream/master' into 24959-union-default
TomAugspurger 8716f97
multi
TomAugspurger f7056d5
doc typo
TomAugspurger e82cbb1
intersection
TomAugspurger 2a2de25
whatsnew
TomAugspurger 5c3da74
update whatsnew
TomAugspurger ce6d1db
Merge remote-tracking branch 'upstream/master' into 24959-union-default
TomAugspurger 52a2f2f
symdiff
TomAugspurger bb848f1
whatsnew
TomAugspurger b15dc7e
doc
TomAugspurger 27b5b16
index multi
TomAugspurger 1564d4f
Change True to None; disallow True
jorisvandenbossche cb54640
fix concat tests
jorisvandenbossche 05a0ed0
pep8
jorisvandenbossche 5e1b831
keep inconsistent behaviour for MultiIndex.difference
jorisvandenbossche 32a5966
docstring updates
jorisvandenbossche d234a1d
fix linting + catch remaining RuntimeWarning
jorisvandenbossche 260aba2
more linting
jorisvandenbossche 41c24f0
update whatsnew
TomAugspurger 2e181ac
xfail trues
TomAugspurger 1c5a037
fixup [ci skip]
TomAugspurger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update whatsnew
- Loading branch information
commit 41c24f03b43b162ec4258187ff7196b2534b22ab
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,14 +30,20 @@ The default *behavior*, however, remains the same: the result is sorted, unless | |
2. ``self`` or ``other`` is empty | ||
3. ``self`` or ``other`` contain values that can not be compared (a ``RuntimeWarning`` is raised). | ||
|
||
This change will allow to preserve ``sort=True`` to mean "always sort" in a future release. | ||
This change will allow ``sort=True`` to mean "always sort" in a future release. | ||
|
||
The same change applies to :meth:`Index.difference` and :meth:`Index.symmetric_difference`, which | ||
would do not sort the result when the values could not be compared. | ||
|
||
For :meth:`Index.intersection` the option of ``sort=True`` is also renamed | ||
to ``sort=None`` (but for :meth:`Index.intersection` it is not the default), as | ||
the result is not sorted when ``self`` and ``other`` were identical. | ||
The `sort` option for :meth:`Index.intersection` has changed in three ways. | ||
|
||
1. The default has changed from ``True`` to ``False``, to restore the | ||
pandas 0.23.4 and earlier behavior of not sorting by default. | ||
2. The behavior of ``sort=True`` can now be obtained with ``sort=None``. | ||
This will sort the result only if the values in ``self`` and ``other`` | ||
are not identical. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "...are not identical or either is empty."? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For intersection that'd be empty, which we can claim is sorted :) |
||
3. The value ``sort=True`` is no longer allowed. A future version of pandas | ||
will properly support ``sort=True`` meaning "always sort". | ||
|
||
.. _whatsnew_0241.regressions: | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.