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

Function _is_homogeneous_mgr

pandas/core/internals/concat.py:191–201  ·  view source on GitHub ↗

Check if this Manager can be treated as a single ndarray.

(mgr: BlockManager, first_dtype: DtypeObj)

Source from the content-addressed store, hash-verified

189
190
191def _is_homogeneous_mgr(mgr: BlockManager, first_dtype: DtypeObj) -> bool:
192 """
193 Check if this Manager can be treated as a single ndarray.
194 """
195 if mgr.nblocks != 1:
196 return False
197 blk = mgr.blocks[0]
198 if not (blk.mgr_locs.is_slice_like and blk.mgr_locs.as_slice.step == 1):
199 return False
200
201 return blk.dtype == first_dtype
202
203
204def _concat_homogeneous_fastpath(

Callers 1

concatenate_managersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected