Skip to content

Commit

Permalink
managers: Remove create_block_manager_from_blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
irgolic committed Jan 22, 2021
1 parent f7d1f28 commit d40acbe
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
2 changes: 0 additions & 2 deletions pandas/core/internals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
BlockManager,
SingleBlockManager,
create_block_manager_from_arrays,
create_block_manager_from_blocks,
)

__all__ = [
Expand All @@ -40,5 +39,4 @@
"concatenate_block_managers",
# those two are preserved here for downstream compatibility (GH-33892)
"create_block_manager_from_arrays",
"create_block_manager_from_blocks",
]
22 changes: 0 additions & 22 deletions pandas/core/internals/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1633,28 +1633,6 @@ def fast_xs(self, loc):
# Constructor Helpers


def create_block_manager_from_blocks(blocks, axes: List[Index]) -> BlockManager:
if len(blocks) == 1 and not isinstance(blocks[0], Block):
# if blocks[0] is of length 0, return empty blocks
if not len(blocks[0]):
blocks = []
else:
# It's OK if a single block is passed as values, its placement
# is basically "all items", but if there're many, don't bother
# converting, it's an error anyway.
return create_block_manager_from_array(blocks[0], axes)

try:
mgr = BlockManager(blocks, axes)
mgr._consolidate_inplace()
return mgr

except ValueError as e:
blocks = [getattr(b, "values", b) for b in blocks]
tot_items = sum(b.shape[0] for b in blocks)
raise construction_error(tot_items, blocks[0].shape[1:], axes, e)


def create_block_manager_from_arrays(
arrays, names: Index, axes: List[Index]
) -> BlockManager:
Expand Down

0 comments on commit d40acbe

Please sign in to comment.