MCPcopy
hub / github.com/pandas-dev/pandas / from_array

Method from_array

pandas/core/internals/managers.py:2054–2063  ·  view source on GitHub ↗

Constructor for if we have an array that is not yet a Block.

(
        cls, array: ArrayLike, index: Index, refs: BlockValuesRefs | None = None
    )

Source from the content-addressed store, hash-verified

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 """

Callers 4

__init__Method · 0.80
grouped_reduceMethod · 0.80
_get_resultFunction · 0.80

Calls 3

maybe_coerce_valuesFunction · 0.90
new_blockFunction · 0.90
clsFunction · 0.85