File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -158,9 +158,11 @@ Deprecations
158
158
159
159
Performance improvements
160
160
~~~~~~~~~~~~~~~~~~~~~~~~
161
+ - Performance improvement in :func: `concat ` with ``axis=1 `` and objects with unaligned indexes (:issue: `55084 `)
161
162
- Performance improvement in :func: `to_dict ` on converting DataFrame to dictionary (:issue: `50990 `)
162
163
- Performance improvement in :meth: `DataFrame.sort_index ` and :meth: `Series.sort_index ` when indexed by a :class: `MultiIndex ` (:issue: `54835 `)
163
164
- Performance improvement when indexing with more than 4 keys (:issue: `54550 `)
165
+ -
164
166
165
167
.. ---------------------------------------------------------------------------
166
168
.. _whatsnew_220.bug_fixes :
Original file line number Diff line number Diff line change @@ -239,8 +239,12 @@ def _unique_indices(inds, dtype) -> Index:
239
239
Index
240
240
"""
241
241
if all (isinstance (ind , Index ) for ind in inds ):
242
- result = inds [0 ].append (inds [1 :]).unique ()
243
- result = result .astype (dtype , copy = False )
242
+ inds = [ind .astype (dtype , copy = False ) for ind in inds ]
243
+ result = inds [0 ].unique ()
244
+ other = inds [1 ].append (inds [2 :])
245
+ diff = other [result .get_indexer_for (other ) == - 1 ]
246
+ if len (diff ):
247
+ result = result .append (diff .unique ())
244
248
if sort :
245
249
result = result .sort_values ()
246
250
return result
You can’t perform that action at this time.
0 commit comments