Skip to content

Commit

Permalink
GH#24845
Browse files Browse the repository at this point in the history
  • Loading branch information
YuRenee committed Dec 14, 2020
1 parent 9c868fa commit 2fee99a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4440,11 +4440,9 @@ def sort_index(
inplace = validate_bool_kwarg(inplace, "inplace")
axis = self._get_axis_number(axis)
target = self._get_axis(axis)

indexer = get_indexer_indexer(
target, level, ascending, kind, na_position, sort_remaining, key
)

if indexer is None:
if inplace:
return
Expand Down
5 changes: 2 additions & 3 deletions pandas/core/reshape/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ def __init__(
):
objs = non_empties
sample = objs[0]

if sample is None:
sample = objs[0]
self.objs = objs
Expand Down Expand Up @@ -502,12 +501,12 @@ def get_result(self):
obj_labels = obj.axes[1 - ax]
if not new_labels.equals(obj_labels):
indexers[ax] = obj_labels.reindex(new_labels)[1]

mgrs_indexers.append((obj._mgr, indexers))

new_data = concatenate_block_managers(
mgrs_indexers, self.new_axes, concat_axis=self.bm_axis, copy=self.copy
)

if not self.copy:
new_data._consolidate_inplace()

Expand Down Expand Up @@ -578,13 +577,13 @@ def _get_concat_axis(self) -> Index:

if self.keys is None:
concat_axis = _concat_indexes(indexes)

else:
concat_axis = _make_concat_multiindex(
indexes, self.keys, self.levels, self.names
)

self._maybe_check_integrity(concat_axis)

return concat_axis

def _maybe_check_integrity(self, concat_index: Index):
Expand Down

0 comments on commit 2fee99a

Please sign in to comment.