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

Method make_block

pandas/core/internals/blocks.py:229–244  ·  view source on GitHub ↗

Create a new block, with type inference propagate any values that are not specified

(
        self,
        values,
        placement: BlockPlacement | None = None,
        refs: BlockValuesRefs | None = None,
    )

Source from the content-addressed store, hash-verified

227
228 @final
229 def make_block(
230 self,
231 values,
232 placement: BlockPlacement | None = None,
233 refs: BlockValuesRefs | None = None,
234 ) -> Block:
235 """
236 Create a new block, with type inference propagate any values that are
237 not specified
238 """
239 if placement is None:
240 placement = self._mgr_locs
241 if self.is_extension:
242 values = ensure_block_shape(values, ndim=self.ndim)
243
244 return new_block(values, placement=placement, ndim=self.ndim, refs=refs)
245
246 @final
247 def make_block_same_class(

Callers 9

reduceMethod · 0.95
_split_op_resultMethod · 0.95
convertMethod · 0.95
astypeMethod · 0.95
get_values_for_csvMethod · 0.95
take_ndMethod · 0.95
whereMethod · 0.95
diffMethod · 0.95

Calls 2

ensure_block_shapeFunction · 0.85
new_blockFunction · 0.85

Tested by 1