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

Method _slice

pandas/core/generic.py:4296–4307  ·  view source on GitHub ↗

Construct a slice of this container. Slicing with this method is *always* positional.

(self, slobj: slice, axis: AxisInt = 0)

Source from the content-addressed store, hash-verified

4294 return self._slice(slobj)
4295
4296 def _slice(self, slobj: slice, axis: AxisInt = 0) -> Self:
4297 """
4298 Construct a slice of this container.
4299
4300 Slicing with this method is *always* positional.
4301 """
4302 assert isinstance(slobj, slice), type(slobj)
4303 axis = self._get_block_manager_axis(axis)
4304 new_mgr = self._mgr.get_slice(slobj, axis=axis)
4305 result = self._constructor_from_mgr(new_mgr, axes=new_mgr.axes)
4306 result = result.__finalize__(self)
4307 return result
4308
4309 @final
4310 def __delitem__(self, key) -> None:

Callers 1

_getitem_sliceMethod · 0.95

Calls 4

get_sliceMethod · 0.80
__finalize__Method · 0.80
_constructor_from_mgrMethod · 0.45

Tested by

no test coverage detected