Skip to content

Commit 8ede846

Browse files
author
Marco Gorelli
committed
Revert patch to original
1 parent 169a4c5 commit 8ede846

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/_libs/reduction.pyx

+4-2
Original file line numberDiff line numberDiff line change
@@ -499,10 +499,12 @@ def apply_frame_axis0(object frame, object f, object names,
499499
# `piece` might not have an index, could be e.g. an int
500500
pass
501501

502-
if not is_scalar(piece):
502+
if isinstance(piece, list):
503+
piece = deepcopy(piece)
504+
elif not is_scalar(piece):
503505
# Need to copy data to avoid appending references
504506
if hasattr(piece, "copy"):
505-
piece = deepcopy(piece)
507+
piece = piece.copy(deep="all")
506508
else:
507509
piece = copy(piece)
508510

0 commit comments

Comments
 (0)