Skip to content

Commit e73364f

Browse files
gfyoungtm9k1
authored andcommitted
CLN: Remove pandas.tools module (pandas-dev#23376)
xref pandas-devgh-15358. xref pandas-devgh-16005.
1 parent 4097f91 commit e73364f

File tree

8 files changed

+3
-114
lines changed

8 files changed

+3
-114
lines changed

doc/source/whatsnew/v0.24.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,7 @@ Removal of prior version deprecations/changes
953953
- :meth:`TimedeltaIndex.searchsorted`, :meth:`DatetimeIndex.searchsorted`, and :meth:`PeriodIndex.searchsorted` have renamed the ``key`` argument to ``value`` (:issue:`14645`)
954954
- :meth:`DataFrame.consolidate` and :meth:`Series.consolidate` have been removed (:issue:`15501`)
955955
- Removal of the previously deprecated module ``pandas.json`` (:issue:`19944`)
956+
- The module ``pandas.tools`` has been removed (:issue:`15358`, :issue:`16005`)
956957
- :meth:`SparseArray.get_values` and :meth:`SparseArray.to_dense` have dropped the ``fill`` parameter (:issue:`14686`)
957958
- :meth:`DataFrame.sortlevel` and :meth:`Series.sortlevel` have been removed (:issue:`15099`)
958959
- :meth:`SparseSeries.to_dense` has dropped the ``sparse_only`` parameter (:issue:`14686`)

pandas/__init__.py

-8
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@
4545
from pandas.core.computation.api import *
4646
from pandas.core.reshape.api import *
4747

48-
# deprecate tools.plotting, plot_params and scatter_matrix on the top namespace
49-
import pandas.tools.plotting
50-
plot_params = pandas.plotting._style._Options(deprecated=True)
51-
# do not import deprecate to top namespace
52-
scatter_matrix = pandas.util._decorators.deprecate(
53-
'pandas.scatter_matrix', pandas.plotting.scatter_matrix, '0.20.0',
54-
'pandas.plotting.scatter_matrix')
55-
5648
from pandas.util._print_versions import show_versions
5749
from pandas.io.api import *
5850
from pandas.util._tester import test

pandas/plotting/_style.py

-10
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,14 @@ def __init__(self, deprecated=False):
110110
# self['xaxis.compat'] = False
111111
super(_Options, self).__setitem__('xaxis.compat', False)
112112

113-
def _warn_if_deprecated(self):
114-
if self._deprecated:
115-
warnings.warn("'pandas.plot_params' is deprecated. Use "
116-
"'pandas.plotting.plot_params' instead",
117-
FutureWarning, stacklevel=3)
118-
119113
def __getitem__(self, key):
120-
self._warn_if_deprecated()
121114
key = self._get_canonical_key(key)
122115
if key not in self:
123116
raise ValueError(
124117
'{key} is not a valid pandas plotting option'.format(key=key))
125118
return super(_Options, self).__getitem__(key)
126119

127120
def __setitem__(self, key, value):
128-
self._warn_if_deprecated()
129121
key = self._get_canonical_key(key)
130122
return super(_Options, self).__setitem__(key, value)
131123

@@ -148,7 +140,6 @@ def reset(self):
148140
-------
149141
None
150142
"""
151-
self._warn_if_deprecated()
152143
self.__init__()
153144

154145
def _get_canonical_key(self, key):
@@ -160,7 +151,6 @@ def use(self, key, value):
160151
Temporarily set a parameter value using the with statement.
161152
Aliasing allowed.
162153
"""
163-
self._warn_if_deprecated()
164154
old_value = self[key]
165155
try:
166156
self[key] = value

pandas/tests/api/test_api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class TestPDApi(Base):
2929

3030
# top-level sub-packages
3131
lib = ['api', 'compat', 'core', 'errors', 'pandas',
32-
'plotting', 'test', 'testing', 'tools', 'tseries',
32+
'plotting', 'test', 'testing', 'tseries',
3333
'util', 'options', 'io']
3434

3535
# these are already deprecated; awaiting removal
@@ -88,7 +88,7 @@ class TestPDApi(Base):
8888
deprecated_funcs_in_future = []
8989

9090
# these are already deprecated; awaiting removal
91-
deprecated_funcs = ['plot_params', 'scatter_matrix']
91+
deprecated_funcs = []
9292

9393
def test_api(self):
9494

pandas/tests/plotting/test_deprecated.py

-57
This file was deleted.

pandas/tools/__init__.py

Whitespace-only changes.

pandas/tools/merge.py

-17
This file was deleted.

pandas/tools/plotting.py

-20
This file was deleted.

0 commit comments

Comments
 (0)