We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6792f5c commit 5266143Copy full SHA for 5266143
pandas/core/indexes/api.py
@@ -157,7 +157,7 @@ def _get_combined_index(
157
index = union_indexes(indexes, sort=False)
158
index = ensure_index(index)
159
160
- if sort and not index.is_monotonic_increasing:
+ if sort:
161
index = safe_sort_index(index)
162
# GH 29879
163
if copy:
@@ -180,6 +180,9 @@ def safe_sort_index(index: Index) -> Index:
180
-------
181
Index
182
"""
183
+ if index.is_monotonic_increasing:
184
+ return index
185
+
186
try:
187
array_sorted = safe_sort(index)
188
except TypeError:
0 commit comments