Skip to content

Commit 050b5b8

Browse files
committed
Use copy and pass deep
1 parent 1b4c156 commit 050b5b8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/core/internals/managers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,15 +719,14 @@ def copy(self, *, deep: bool) -> Self:
719719
Parameters
720720
----------
721721
deep : bool, string or None, default True
722-
If False or None, return a shallow copy (do not copy data)
723-
If 'all', copy data and a deep copy of the index
722+
If False, return a shallow copy (do not copy data)
724723
725724
Returns
726725
-------
727726
BlockManager
728727
"""
729728
# this preserves the notion of view copying of axes
730-
new_axes = [ax.view() for ax in self.axes]
729+
new_axes = [ax.copy(deep=deep) for ax in self.axes]
731730

732731
res = self.apply("copy", deep=deep)
733732
res.axes = new_axes

0 commit comments

Comments
 (0)