File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -158,9 +158,11 @@ Deprecations
158158
159159Performance improvements
160160~~~~~~~~~~~~~~~~~~~~~~~~
161+ - Performance improvement in :func: `concat ` with ``axis=1 `` and objects with unaligned indexes (:issue: `55084 `)
161162- Performance improvement in :func: `to_dict ` on converting DataFrame to dictionary (:issue: `50990 `)
162163- Performance improvement in :meth: `DataFrame.sort_index ` and :meth: `Series.sort_index ` when indexed by a :class: `MultiIndex ` (:issue: `54835 `)
163164- Performance improvement when indexing with more than 4 keys (:issue: `54550 `)
165+ -
164166
165167.. ---------------------------------------------------------------------------
166168 .. _whatsnew_220.bug_fixes :
Original file line number Diff line number Diff line change @@ -239,8 +239,12 @@ def _unique_indices(inds, dtype) -> Index:
239239 Index
240240 """
241241 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 ())
244248 if sort :
245249 result = result .sort_values ()
246250 return result
You can’t perform that action at this time.
0 commit comments