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

Method test_iget

pandas/tests/internals/test_internals.py:433–445  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

431 )
432
433 def test_iget(self):
434 cols = Index(list("abc"))
435 values = np.random.default_rng(2).random((3, 3))
436 block = new_block(
437 values=values.copy(),
438 placement=BlockPlacement(np.arange(3, dtype=np.intp)),
439 ndim=values.ndim,
440 )
441 mgr = BlockManager(blocks=(block,), axes=[cols, Index(np.arange(3))])
442
443 tm.assert_almost_equal(mgr.iget(0).internal_values(), values[0])
444 tm.assert_almost_equal(mgr.iget(1).internal_values(), values[1])
445 tm.assert_almost_equal(mgr.iget(2).internal_values(), values[2])
446
447 def test_set(self):
448 mgr = create_mgr("a,b,c: int", item_shape=(3,))

Callers

nothing calls this directly

Calls 6

igetMethod · 0.95
IndexClass · 0.90
new_blockFunction · 0.90
BlockManagerClass · 0.90
internal_valuesMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected