Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pandas/core/internals/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ def apply(
if ignore_failures:
return self._combine(result_blocks)

return type(self).from_blocks(result_blocks, self.axes)
out = type(self).from_blocks(result_blocks, self.axes)
return out

def where(self: T, other, cond, align: bool, errors: str) -> T:
if align:
Expand Down Expand Up @@ -589,8 +590,14 @@ def copy_func(ax):
new_axes = list(self.axes)

res = self.apply("copy", deep=deep)

res.axes = new_axes

if self.ndim > 1:
# Avoid needing to re-compute these
res._blknos = self.blknos.copy()
res._blklocs = self.blklocs.copy()

if deep:
res._consolidate_inplace()
return res
Expand Down