Constructor for if we have an array that is not yet a Block.
(
cls, array: ArrayLike, index: Index, refs: BlockValuesRefs | None = None
)
| 2052 | |
| 2053 | @classmethod |
| 2054 | def from_array( |
| 2055 | cls, array: ArrayLike, index: Index, refs: BlockValuesRefs | None = None |
| 2056 | ) -> SingleBlockManager: |
| 2057 | """ |
| 2058 | Constructor for if we have an array that is not yet a Block. |
| 2059 | """ |
| 2060 | array = maybe_coerce_values(array) |
| 2061 | bp = BlockPlacement(slice(0, len(index))) |
| 2062 | block = new_block(array, placement=bp, ndim=1, refs=refs) |
| 2063 | return cls(block, index) |
| 2064 | |
| 2065 | def to_2d_mgr(self, columns: Index) -> BlockManager: |
| 2066 | """ |