diff --git a/doc/source/whatsnew/v0.24.0.txt b/doc/source/whatsnew/v0.24.0.txt index 768868d5857214..12ec4aba9de48f 100644 --- a/doc/source/whatsnew/v0.24.0.txt +++ b/doc/source/whatsnew/v0.24.0.txt @@ -946,6 +946,7 @@ Removal of prior version deprecations/changes - :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`) - Removal of the previously deprecated module ``pandas.json`` (:issue:`19944`) +- The module ``pandas.tools`` has been removed (:issue:`15358`, :issue:`16005`) - :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/__init__.py b/pandas/__init__.py index e446782d9665e2..f709ef4f36c7c3 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -45,14 +45,6 @@ from pandas.core.computation.api import * from pandas.core.reshape.api import * -# deprecate tools.plotting, plot_params and scatter_matrix on the top namespace -import pandas.tools.plotting -plot_params = pandas.plotting._style._Options(deprecated=True) -# do not import deprecate to top namespace -scatter_matrix = pandas.util._decorators.deprecate( - 'pandas.scatter_matrix', pandas.plotting.scatter_matrix, '0.20.0', - 'pandas.plotting.scatter_matrix') - from pandas.util._print_versions import show_versions from pandas.io.api import * from pandas.util._tester import test diff --git a/pandas/plotting/_style.py b/pandas/plotting/_style.py index 9bc12d22e1685f..da26c0f8fa7e21 100644 --- a/pandas/plotting/_style.py +++ b/pandas/plotting/_style.py @@ -110,14 +110,7 @@ def __init__(self, deprecated=False): # self['xaxis.compat'] = False super(_Options, self).__setitem__('xaxis.compat', False) - def _warn_if_deprecated(self): - if self._deprecated: - warnings.warn("'pandas.plot_params' is deprecated. Use " - "'pandas.plotting.plot_params' instead", - FutureWarning, stacklevel=3) - def __getitem__(self, key): - self._warn_if_deprecated() key = self._get_canonical_key(key) if key not in self: raise ValueError( @@ -125,7 +118,6 @@ def __getitem__(self, key): return super(_Options, self).__getitem__(key) def __setitem__(self, key, value): - self._warn_if_deprecated() key = self._get_canonical_key(key) return super(_Options, self).__setitem__(key, value) @@ -148,7 +140,6 @@ def reset(self): ------- None """ - self._warn_if_deprecated() self.__init__() def _get_canonical_key(self, key): @@ -160,7 +151,6 @@ def use(self, key, value): Temporarily set a parameter value using the with statement. Aliasing allowed. """ - self._warn_if_deprecated() old_value = self[key] try: self[key] = value diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py index 1a234cdfe3518c..a566f76c73ce05 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -30,7 +30,7 @@ class TestPDApi(Base): # top-level sub-packages lib = ['api', 'compat', 'core', 'errors', 'pandas', - 'plotting', 'test', 'testing', 'tools', 'tseries', + 'plotting', 'test', 'testing', 'tseries', 'util', 'options', 'io'] # these are already deprecated; awaiting removal @@ -89,8 +89,7 @@ class TestPDApi(Base): deprecated_funcs_in_future = [] # these are already deprecated; awaiting removal - deprecated_funcs = ['pnow', 'match', 'groupby', 'get_store', - 'plot_params', 'scatter_matrix'] + deprecated_funcs = ['pnow', 'match', 'groupby', 'get_store'] def test_api(self): diff --git a/pandas/tests/plotting/test_deprecated.py b/pandas/tests/plotting/test_deprecated.py deleted file mode 100644 index a45b17ec98261f..00000000000000 --- a/pandas/tests/plotting/test_deprecated.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -import string - -import pandas as pd -import pandas.util.testing as tm -import pandas.util._test_decorators as td -import pytest - -from numpy.random import randn - -import pandas.tools.plotting as plotting - -from pandas.tests.plotting.common import TestPlotBase - - -""" -Test cases for plot functions imported from deprecated -pandas.tools.plotting -""" - - -@td.skip_if_no_mpl -class TestDeprecatedNameSpace(TestPlotBase): - - @pytest.mark.slow - @td.skip_if_no_scipy - def test_scatter_plot_legacy(self): - df = pd.DataFrame(randn(100, 2)) - - with tm.assert_produces_warning(FutureWarning): - plotting.scatter_matrix(df) - - with tm.assert_produces_warning(FutureWarning): - pd.scatter_matrix(df) - - @pytest.mark.slow - def test_boxplot_deprecated(self): - df = pd.DataFrame(randn(6, 4), - index=list(string.ascii_letters[:6]), - columns=['one', 'two', 'three', 'four']) - df['indic'] = ['foo', 'bar'] * 3 - - with tm.assert_produces_warning(FutureWarning): - plotting.boxplot(df, column=['one', 'two'], - by='indic') - - @pytest.mark.slow - def test_radviz_deprecated(self, iris): - with tm.assert_produces_warning(FutureWarning): - plotting.radviz(frame=iris, class_column='Name') - - @pytest.mark.slow - def test_plot_params(self): - - with tm.assert_produces_warning(FutureWarning): - pd.plot_params['xaxis.compat'] = True diff --git a/pandas/tools/__init__.py b/pandas/tools/__init__.py deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/pandas/tools/merge.py b/pandas/tools/merge.py deleted file mode 100644 index cd58aa2c7f9239..00000000000000 --- a/pandas/tools/merge.py +++ /dev/null @@ -1,17 +0,0 @@ -import warnings - - -# back-compat of pseudo-public API -def concat_wrap(): - - def wrapper(*args, **kwargs): - warnings.warn("pandas.tools.merge.concat is deprecated. " - "import from the public API: " - "pandas.concat instead", - FutureWarning, stacklevel=3) - import pandas as pd - return pd.concat(*args, **kwargs) - return wrapper - - -concat = concat_wrap() diff --git a/pandas/tools/plotting.py b/pandas/tools/plotting.py deleted file mode 100644 index a68da67a219e2f..00000000000000 --- a/pandas/tools/plotting.py +++ /dev/null @@ -1,20 +0,0 @@ -import sys -import warnings - -import pandas.plotting as _plotting - -# back-compat of public API -# deprecate these functions -m = sys.modules['pandas.tools.plotting'] -for t in [t for t in dir(_plotting) if not t.startswith('_')]: - - def outer(t=t): - - def wrapper(*args, **kwargs): - warnings.warn("'pandas.tools.plotting.{t}' is deprecated, " - "import 'pandas.plotting.{t}' instead.".format(t=t), - FutureWarning, stacklevel=2) - return getattr(_plotting, t)(*args, **kwargs) - return wrapper - - setattr(m, t, outer(t))