Skip to content

Commit 2af8710

Browse files
committed
Add two new methods _get_data and get_data
1 parent 297846e commit 2af8710

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

pandas/core/generic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5168,6 +5168,9 @@ def _check_inplace_setting(self, value):
51685168

51695169
return True
51705170

5171+
def _get_data(self):
5172+
return self._constructor(self._data.get_data()).__finalize__(self)
5173+
51715174
def _get_numeric_data(self):
51725175
return self._constructor(
51735176
self._data.get_numeric_data()).__finalize__(self)

pandas/core/internals/managers.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ def is_view(self):
632632

633633
return False
634634

635-
def get_bool_data(self, copy=False):
635+
def get_data(self, copy=False):
636636
"""
637637
Parameters
638638
----------
@@ -642,6 +642,16 @@ def get_bool_data(self, copy=False):
642642
self._consolidate_inplace()
643643
return self.combine([b for b in self.blocks], copy)
644644

645+
def get_bool_data(self, copy=False):
646+
"""
647+
Parameters
648+
----------
649+
copy : boolean, default False
650+
Whether to copy the blocks
651+
"""
652+
self._consolidate_inplace()
653+
return self.combine([b for b in self.blocks if b.is_bool], copy)
654+
645655
def get_numeric_data(self, copy=False):
646656
"""
647657
Parameters

0 commit comments

Comments
 (0)