diff --git a/doc/source/whatsnew/v0.24.0.txt b/doc/source/whatsnew/v0.24.0.txt index cecc5e1f2144e7..ff9b91a0878f3c 100644 --- a/doc/source/whatsnew/v0.24.0.txt +++ b/doc/source/whatsnew/v0.24.0.txt @@ -948,6 +948,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`) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index a80b6df703df06..44497c5dcb377e 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -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 @@ -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 diff --git a/pandas/tests/frame/test_block_internals.py b/pandas/tests/frame/test_block_internals.py index 5f1d4954521ed0..8a7d7d790a1b43 100644 --- a/pandas/tests/frame/test_block_internals.py +++ b/pandas/tests/frame/test_block_internals.py @@ -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