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

Method iget

pandas/core/internals/managers.py:1226–1238  ·  view source on GitHub ↗

Return the data as a SingleBlockManager.

(self, i: int, track_ref: bool = True)

Source from the content-addressed store, hash-verified

1224 return SingleBlockManager(block, self.axes[0].view())
1225
1226 def iget(self, i: int, track_ref: bool = True) -> SingleBlockManager:
1227 """
1228 Return the data as a SingleBlockManager.
1229 """
1230 block = self.blocks[self.blknos[i]]
1231 values = block.iget(self.blklocs[i])
1232
1233 # shortcut for select a single-dim from a 2-dim BM
1234 bp = BlockPlacement(slice(0, len(values)))
1235 nb = type(block)(
1236 values, placement=bp, ndim=1, refs=block.refs if track_ref else None
1237 )
1238 return SingleBlockManager(nb, self.axes[1].view())
1239
1240 def iget_values(self, i: int) -> ArrayLike:
1241 """

Callers 5

column_setitemMethod · 0.95
test_igetMethod · 0.95
fast_xsMethod · 0.45
iget_valuesMethod · 0.45

Calls 2

SingleBlockManagerClass · 0.85
viewMethod · 0.45

Tested by 2

test_igetMethod · 0.76