Skip to content

API: Change default for Index.union sort #25007

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
Prev Previous commit
Next Next commit
whatsnew
  • Loading branch information
TomAugspurger committed Jan 31, 2019
commit bb848f19a68ccb3a3a74f366a26dd152d9f4ad12
5 changes: 4 additions & 1 deletion doc/source/whatsnew/v0.24.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ API Changes
Changing the ``sort`` parameter for :meth:`Index.union`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The default ``sort`` value for :meth:`Index.union` has changed from ``True`` to ``None``.
The default ``sort`` value for :meth:`Index.union` has changed from ``True`` to ``None`` (:issue:`24959`).
The default *behavior* remains the same: The result is sorted, unless

1. ``self`` and ``other`` are identical
Expand Down Expand Up @@ -53,6 +53,9 @@ This allows ``sort=True`` to now mean "always sort". A ``TypeError`` is raised i

idx.union(idx, sort=True)

The same change applies to :meth:`Index.symmetric_difference`, which would previously not
sort the result when ``sort=True`` but the values could not be compared.

Changed the behavior of :meth:`Index.intersection` with ``sort=True``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down