Skip to content

CLN: Remove the .consolidate method #23377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -945,6 +945,7 @@ Removal of prior version deprecations/changes
- Removed the ``pandas.formats.style`` shim for :class:`pandas.io.formats.style.Styler` (:issue:`16059`)
- :meth:`Categorical.searchsorted` and :meth:`Series.searchsorted` have renamed the ``v`` argument to ``value`` (:issue:`14645`)
- :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