Skip to content

Commit c7d654b

Browse files
jrebackpcluo
authored andcommitted
DEPR: deprecate pandas.api.types.is_sequence (pandas-dev#16189)
xref pandas-dev#16042
1 parent 64fffd8 commit c7d654b

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

doc/source/api.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -1969,15 +1969,14 @@ Dtype introspection
19691969

19701970
Iterable introspection
19711971

1972+
.. autosummary::
1973+
:toctree: generated/
1974+
19721975
api.types.is_dict_like
19731976
api.types.is_file_like
19741977
api.types.is_list_like
19751978
api.types.is_named_tuple
19761979
api.types.is_iterator
1977-
api.types.is_sequence
1978-
1979-
.. autosummary::
1980-
:toctree: generated/
19811980

19821981
Scalar introspection
19831982

doc/source/whatsnew/v0.20.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,7 @@ Other Deprecations
15211521
* ``pd.match()``, is removed.
15221522
* ``pd.groupby()``, replaced by using the ``.groupby()`` method directly on a ``Series/DataFrame``
15231523
* ``pd.get_store()``, replaced by a direct call to ``pd.HDFStore(...)``
1524-
- ``is_any_int_dtype`` and ``is_floating_dtype`` are deprecated from ``pandas.api.types`` (:issue:`16042`)
1524+
- ``is_any_int_dtype``, ``is_floating_dtype``, and ``is_sequence`` are deprecated from ``pandas.api.types`` (:issue:`16042`)
15251525

15261526
.. _whatsnew_0200.prior_deprecations:
15271527

pandas/core/dtypes/api.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,13 @@
5757
is_file_like,
5858
is_list_like,
5959
is_hashable,
60-
is_named_tuple,
61-
is_sequence)
60+
is_named_tuple)
6261

6362

6463
# deprecated
6564
m = sys.modules['pandas.core.dtypes.api']
6665

67-
for t in ['is_any_int_dtype', 'is_floating_dtype']:
66+
for t in ['is_any_int_dtype', 'is_floating_dtype', 'is_sequence']:
6867

6968
def outer(t=t):
7069

pandas/tests/api/test_types.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ class TestTypes(Base, tm.TestCase):
3131
'is_re', 'is_re_compilable',
3232
'is_dict_like', 'is_iterator', 'is_file_like',
3333
'is_list_like', 'is_hashable',
34-
'is_named_tuple', 'is_sequence',
34+
'is_named_tuple',
3535
'pandas_dtype', 'union_categoricals', 'infer_dtype']
36-
deprecated = ['is_any_int_dtype', 'is_floating_dtype']
36+
deprecated = ['is_any_int_dtype', 'is_floating_dtype', 'is_sequence']
3737
dtypes = ['CategoricalDtype', 'DatetimeTZDtype',
3838
'PeriodDtype', 'IntervalDtype']
3939

@@ -90,7 +90,7 @@ def test_removed_from_core_common(self):
9090

9191
def test_deprecated_from_api_types(self):
9292

93-
for t in ['is_any_int_dtype', 'is_floating_dtype']:
93+
for t in self.deprecated:
9494
with tm.assert_produces_warning(FutureWarning,
9595
check_stacklevel=False):
9696
getattr(types, t)(1)

0 commit comments

Comments
 (0)