diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index bde97f3714219..d8609737b8c7a 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -386,6 +386,7 @@ Removal of prior version deprecations/changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Removed deprecated :attr:`Timestamp.freq`, :attr:`Timestamp.freqstr` and argument ``freq`` from the :class:`Timestamp` constructor and :meth:`Timestamp.fromordinal` (:issue:`14146`) - Removed deprecated :class:`CategoricalBlock`, :meth:`Block.is_categorical`, require datetime64 and timedelta64 values to be wrapped in :class:`DatetimeArray` or :class:`TimedeltaArray` before passing to :meth:`Block.make_block_same_class`, require ``DatetimeTZBlock.values`` to have the correct ndim when passing to the :class:`BlockManager` constructor, and removed the "fastpath" keyword from the :class:`SingleBlockManager` constructor (:issue:`40226`, :issue:`40571`) +- Removed deprecated global option ``use_inf_as_null`` in favor of ``use_inf_as_na`` (:issue:`17126`) - Removed deprecated module ``pandas.core.index`` (:issue:`30193`) - Removed deprecated alias ``pandas.core.tools.datetimes.to_time``, import the function directly from ``pandas.core.tools.times`` instead (:issue:`34145`) - Removed deprecated :meth:`Categorical.to_dense`, use ``np.asarray(cat)`` instead (:issue:`32639`) diff --git a/pandas/core/config_init.py b/pandas/core/config_init.py index b101b25a10a80..d1a52798360bd 100644 --- a/pandas/core/config_init.py +++ b/pandas/core/config_init.py @@ -458,12 +458,6 @@ def is_terminal() -> bool: with cf.config_prefix("mode"): cf.register_option("sim_interactive", False, tc_sim_interactive_doc) -use_inf_as_null_doc = """ -: boolean - use_inf_as_null had been deprecated and will be removed in a future - version. Use `use_inf_as_na` instead. -""" - use_inf_as_na_doc = """ : boolean True means treat None, NaN, INF, -INF as NA (old way), @@ -483,14 +477,6 @@ def use_inf_as_na_cb(key) -> None: with cf.config_prefix("mode"): cf.register_option("use_inf_as_na", False, use_inf_as_na_doc, cb=use_inf_as_na_cb) - cf.register_option( - "use_inf_as_null", False, use_inf_as_null_doc, cb=use_inf_as_na_cb - ) - - -cf.deprecate_option( - "mode.use_inf_as_null", msg=use_inf_as_null_doc, rkey="mode.use_inf_as_na" -) data_manager_doc = """ diff --git a/pandas/tests/series/test_missing.py b/pandas/tests/series/test_missing.py index d956b2c3fcd42..3c0f962b90086 100644 --- a/pandas/tests/series/test_missing.py +++ b/pandas/tests/series/test_missing.py @@ -36,20 +36,6 @@ def test_isna_for_inf(self): tm.assert_series_equal(r, e) tm.assert_series_equal(dr, de) - @pytest.mark.parametrize( - "method, expected", - [ - ["isna", Series([False, True, True, False])], - ["dropna", Series(["a", 1.0], index=[0, 3])], - ], - ) - def test_isnull_for_inf_deprecated(self, method, expected): - # gh-17115 - s = Series(["a", np.inf, np.nan, 1.0]) - with pd.option_context("mode.use_inf_as_null", True): - result = getattr(s, method)() - tm.assert_series_equal(result, expected) - def test_timedelta64_nan(self): td = Series([timedelta(days=i) for i in range(10)])