Skip to content

Commit

Permalink
CLN: Remove the .consolidate method (pandas-dev#23377)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyoung authored and tm9k1 committed Nov 19, 2018
1 parent 9652fc9 commit 08d734f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.24.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ Removal of prior version deprecations/changes
- :meth:`Categorical.searchsorted` and :meth:`Series.searchsorted` have renamed the ``v`` argument to ``value`` (:issue:`14645`)
- ``pandas.parser``, ``pandas.lib``, and ``pandas.tslib`` have been removed (:issue:`15537`)
- :meth:`TimedeltaIndex.searchsorted`, :meth:`DatetimeIndex.searchsorted`, and :meth:`PeriodIndex.searchsorted` have renamed the ``key`` argument to ``value`` (:issue:`14645`)
- :meth:`DataFrame.consolidate` and :meth:`Series.consolidate` have been removed (:issue:`15501`)
- Removal of the previously deprecated module ``pandas.json`` (:issue:`19944`)
- :meth:`SparseArray.get_values` and :meth:`SparseArray.to_dense` have dropped the ``fill`` parameter (:issue:`14686`)
- :meth:`SparseSeries.to_dense` has dropped the ``sparse_only`` parameter (:issue:`14686`)
Expand Down
14 changes: 1 addition & 13 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class NDFrame(PandasObject, SelectionMixin):
_internal_names_set = set(_internal_names)
_accessors = frozenset([])
_deprecations = frozenset(['as_blocks', 'blocks',
'consolidate', 'convert_objects', 'is_copy'])
'convert_objects', 'is_copy'])
_metadata = []
_is_copy = None

Expand Down Expand Up @@ -4722,18 +4722,6 @@ def _consolidate(self, inplace=False):
cons_data = self._protect_consolidate(f)
return self._constructor(cons_data).__finalize__(self)

def consolidate(self, inplace=False):
"""Compute NDFrame with "consolidated" internals (data of each dtype
grouped together in a single ndarray).
.. deprecated:: 0.20.0
Consolidate will be an internal implementation only.
"""
# 15483
warnings.warn("consolidate is deprecated and will be removed in a "
"future release.", FutureWarning, stacklevel=2)
return self._consolidate(inplace)

@property
def _is_mixed_type(self):
f = lambda: self._data.is_mixed_type
Expand Down
5 changes: 0 additions & 5 deletions pandas/tests/frame/test_block_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ def test_consolidate(self, float_frame):
float_frame._consolidate(inplace=True)
assert len(float_frame._data.blocks) == 1

def test_consolidate_deprecation(self, float_frame):
float_frame['E'] = 7
with tm.assert_produces_warning(FutureWarning):
float_frame.consolidate()

def test_consolidate_inplace(self, float_frame):
frame = float_frame.copy() # noqa

Expand Down

0 comments on commit 08d734f

Please sign in to comment.