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

Method get_bool_data

pandas/core/internals/managers.py:680–695  ·  view source on GitHub ↗

Select blocks that are bool-dtype and columns from object-dtype blocks that are all-bool.

(self)

Source from the content-addressed store, hash-verified

678 return indexer
679
680 def get_bool_data(self) -> Self:
681 """
682 Select blocks that are bool-dtype and columns from object-dtype blocks
683 that are all-bool.
684 """
685
686 new_blocks = []
687
688 for blk in self.blocks:
689 if blk.dtype == bool:
690 new_blocks.append(blk)
691
692 elif blk.is_object:
693 new_blocks.extend(nb for nb in blk._split() if nb.is_bool)
694
695 return self._combine(new_blocks)
696
697 def get_numeric_data(self) -> Self:
698 numeric_blocks = [blk for blk in self.blocks if blk.is_numeric]

Callers 2

_get_bool_dataMethod · 0.80
test_get_bool_dataMethod · 0.80

Calls 3

_combineMethod · 0.95
_splitMethod · 0.80
appendMethod · 0.45

Tested by 1

test_get_bool_dataMethod · 0.64