diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 5014a0655dc712..e4fa0d4d2db643 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6514,7 +6514,7 @@ def _join_compat(self, other, on=None, how='left', lsuffix='', rsuffix='', if can_concat: if how == 'left': res = concat(frames, axis=1, join='outer', - verify_integrity=True, copy=False) + verify_integrity=True) res = res.reindex(self.index, copy=False) return res else: diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 24c9b7d03a70b7..15f74c038fb984 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -8930,8 +8930,8 @@ def describe_1d(data): if name not in names: names.append(name) - d = pd.concat([x.reindex(names) for x in ldesc], axis=1, - sort=False, copy=False) + d = pd.concat([x.reindex(names, copy=False) for x in ldesc], + axis=1, sort=False) d.columns = data.columns.copy() return d diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index 7b7476f8c4dfc4..37aea4ed1dfeeb 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -519,8 +519,7 @@ def _transform_general(self, func, *args, **kwargs): concat_index = obj.columns if self.axis == 0 else obj.index other_axis = 1 if self.axis == 0 else 0 # switches between 0 & 1 - concatenated = concat(applied, axis=self.axis, - verify_integrity=False, copy=False) + concatenated = concat(applied, axis=self.axis, verify_integrity=False) concatenated = concatenated.reindex(concat_index, axis=other_axis, copy=False) return self._set_result_index_ordered(concatenated) diff --git a/pandas/core/reshape/concat.py b/pandas/core/reshape/concat.py index d28ed864563fd3..3d5ff24b878264 100644 --- a/pandas/core/reshape/concat.py +++ b/pandas/core/reshape/concat.py @@ -227,6 +227,7 @@ def concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False, res = op.get_result() if join_axes is not None: + # GH 21951 warnings.warn('The join_axes-keyword is deprecated. Use .reindex or ' '.reindex_like on the result to achieve the same ' 'functionality.', FutureWarning, stacklevel=2) @@ -236,12 +237,12 @@ def concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False, "length {length}".format(length=ndim - 1)) if ndim == 2: other_axis = 1 if axis == 0 else 0 # switches between 0 & 1 - res = res.reindex(join_axes[0], axis=other_axis) + res = res.reindex(join_axes[0], axis=other_axis, copy=False) elif ndim == 3: # Panel other_axes = list(range(res.ndim)) other_axes.pop(axis) for i in range(ndim - 1): - res.reindex(join_axes[i], axis=i) + res.reindex(join_axes[i], axis=i, copy=False) return res