Skip to content

ENH: Add lazy copy to concat and round #50501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Jan 17, 2023
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Fix annotation
  • Loading branch information
phofl committed Jan 13, 2023
commit dddc9f0f7ef17a73b46ba98f51e27d1345ffeb8b
6 changes: 2 additions & 4 deletions pandas/core/internals/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import itertools
from typing import (
TYPE_CHECKING,
List,
Optional,
Sequence,
cast,
)
Expand Down Expand Up @@ -273,7 +271,7 @@ def _concat_managers_axis0(

offset = 0
blocks = []
refs = []
refs: list[weakref.ref | None] = []
parent = None
for i, mgr in enumerate(mgrs):
# If we already reindexed, then we definitely don't need another copy
Expand All @@ -299,7 +297,7 @@ def _concat_managers_axis0(

result = BlockManager(tuple(blocks), axes)
result.parent = parent
result.refs = cast(Optional[List[Optional[weakref.ref]]], refs) if refs else None
result.refs = refs if refs else None
return result


Expand Down