From 9e8caf335c08c892bfbf69a01f2c89081bcae44b Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 1 Nov 2022 15:11:36 -0700 Subject: [PATCH 1/3] DEPR: Index methods, to_time, Categorical constructor --- .../benchmarks/index_cached_properties.py | 3 - doc/redirects.csv | 1 - doc/source/reference/indexing.rst | 1 - doc/source/whatsnew/v2.0.0.rst | 7 ++ pandas/core/arrays/categorical.py | 10 +-- pandas/core/base.py | 23 ------- pandas/core/indexes/base.py | 68 ++----------------- pandas/core/indexes/category.py | 12 +--- pandas/core/indexes/multi.py | 11 --- pandas/core/tools/datetimes.py | 21 ------ .../arrays/categorical/test_constructors.py | 11 +-- .../indexes/categorical/test_category.py | 5 -- .../indexes/categorical/test_constructors.py | 9 +-- .../datetimes/methods/test_to_frame.py | 11 ++- pandas/tests/indexes/test_any_index.py | 8 +-- pandas/tests/indexes/test_base.py | 17 ----- pandas/tests/series/test_api.py | 4 +- pandas/tests/series/test_constructors.py | 2 - pandas/tests/tools/test_to_time.py | 10 --- 19 files changed, 27 insertions(+), 207 deletions(-) diff --git a/asv_bench/benchmarks/index_cached_properties.py b/asv_bench/benchmarks/index_cached_properties.py index 1a88bb7eef37a..349841f695416 100644 --- a/asv_bench/benchmarks/index_cached_properties.py +++ b/asv_bench/benchmarks/index_cached_properties.py @@ -70,6 +70,3 @@ def time_engine(self, index_type): def time_inferred_type(self, index_type): self.idx.inferred_type - - def time_is_all_dates(self, index_type): - self.idx.is_all_dates diff --git a/doc/redirects.csv b/doc/redirects.csv index d0f4ae331f7e3..8c89d1ea0aef3 100644 --- a/doc/redirects.csv +++ b/doc/redirects.csv @@ -661,7 +661,6 @@ generated/pandas.Index.identical,../reference/api/pandas.Index.identical generated/pandas.Index.inferred_type,../reference/api/pandas.Index.inferred_type generated/pandas.Index.insert,../reference/api/pandas.Index.insert generated/pandas.Index.intersection,../reference/api/pandas.Index.intersection -generated/pandas.Index.is_all_dates,../reference/api/pandas.Index.is_all_dates generated/pandas.Index.is_boolean,../reference/api/pandas.Index.is_boolean generated/pandas.Index.is_categorical,../reference/api/pandas.Index.is_categorical generated/pandas.Index.is_floating,../reference/api/pandas.Index.is_floating diff --git a/doc/source/reference/indexing.rst b/doc/source/reference/indexing.rst index b7866a0076d84..ea1781955eeaa 100644 --- a/doc/source/reference/indexing.rst +++ b/doc/source/reference/indexing.rst @@ -33,7 +33,6 @@ Properties Index.hasnans Index.dtype Index.inferred_type - Index.is_all_dates Index.shape Index.name Index.names diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index 04e5154ca1a0b..8830e8d972e63 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -159,6 +159,7 @@ Deprecations Removal of prior version deprecations/changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 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`) - Removed deprecated :meth:`Categorical.take_nd` (:issue:`27745`) - Removed deprecated :meth:`Categorical.mode`, use ``Series(cat).mode()`` instead (:issue:`45033`) @@ -182,6 +183,8 @@ Removal of prior version deprecations/changes - Removed deprecated :meth:`.Styler.render` (:issue:`49397`) - Removed deprecated argument ``null_color`` in :meth:`.Styler.highlight_null` (:issue:`49397`) - Removed deprecated ``null_counts`` argument in :meth:`DataFrame.info`. Use ``show_counts`` instead (:issue:`37999`) +- Removed deprecated :meth:`Index.is_monotonic`, and :meth:`Series.is_monotonic`; use ``obj.is_monotonic_increasing`` instead (:issue:`45422`) +- Removed deprecated :meth:`Index.is_all_dates` (:issue:`36697`) - Enforced deprecation disallowing passing a timezone-aware :class:`Timestamp` and ``dtype="datetime64[ns]"`` to :class:`Series` or :class:`DataFrame` constructors (:issue:`41555`) - Enforced deprecation disallowing passing a sequence of timezone-aware values and ``dtype="datetime64[ns]"`` to to :class:`Series` or :class:`DataFrame` constructors (:issue:`41555`) - Enforced deprecation disallowing unit-less "datetime64" dtype in :meth:`Series.astype` and :meth:`DataFrame.astype` (:issue:`47844`) @@ -245,6 +248,8 @@ Removal of prior version deprecations/changes - Disallow passing non-keyword arguments to :meth:`DataFrame.replace`, :meth:`Series.replace` except for ``to_replace`` and ``value`` (:issue:`47587`) - Disallow passing non-keyword arguments to :meth:`DataFrame.sort_values` except for ``by`` (:issue:`41505`) - Disallow passing non-keyword arguments to :meth:`Series.sort_values` (:issue:`41505`) +- Disallowed constructing :class:`Categorical` without scalar ``data`` (:issue:`38433`) +- Disallowed constructing :class:`CategoricalIndex` without passing ``data`` (:issue:`38944`) - Removed :meth:`.Rolling.validate`, :meth:`.Expanding.validate`, and :meth:`.ExponentialMovingWindow.validate` (:issue:`43665`) - Removed :attr:`Rolling.win_type` returning ``"freq"`` (:issue:`38963`) - Removed :attr:`Rolling.is_datetimelike` (:issue:`38963`) @@ -286,6 +291,8 @@ Removal of prior version deprecations/changes - Changed behavior of empty data passed into :class:`Series`; the default dtype will be ``object`` instead of ``float64`` (:issue:`29405`) - Changed the behavior of :func:`to_datetime` with argument "now" with ``utc=False`` to match ``Timestamp("now")`` (:issue:`18705`) - Changed behavior of :meth:`SparseArray.astype` when given a dtype that is not explicitly ``SparseDtype``, cast to the exact requested dtype rather than silently using a ``SparseDtype`` instead (:issue:`34457`) +- Changed behavior of :meth:`Index.ravel` to return a view on the original :class:`Index` instead of a ``np.ndarray`` (:issue:`36900`) +- Changed behavior of :meth:`Index.to_frame` with explicit ``name=None`` to use ``None`` for the column name instead of the index's name or default ``0`` (:issue:`45523`) - Changed behavior of :class:`DataFrame` constructor given floating-point ``data`` and an integer ``dtype``, when the data cannot be cast losslessly, the floating point dtype is retained, matching :class:`Series` behavior (:issue:`41170`) - Changed behavior of :class:`DataFrame` constructor when passed a ``dtype`` (other than int) that the data cannot be cast to; it now raises instead of silently ignoring the dtype (:issue:`41733`) - Changed the behavior of :class:`Series` constructor, it will no longer infer a datetime64 or timedelta64 dtype from string entries (:issue:`41731`) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index becca2b668290..4cacdb71f4175 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -15,7 +15,6 @@ cast, overload, ) -from warnings import warn import numpy as np @@ -40,7 +39,6 @@ type_t, ) from pandas.compat.numpy import function as nv -from pandas.util._exceptions import find_stack_level from pandas.util._validators import validate_bool_kwarg from pandas.core.dtypes.cast import ( @@ -384,13 +382,7 @@ def __init__( if not is_list_like(values): # GH#38433 - warn( - "Allowing scalars in the Categorical constructor is deprecated " - "and will raise in a future version. Use `[value]` instead", - FutureWarning, - stacklevel=find_stack_level(), - ) - values = [values] + raise TypeError("Categorical input must be list-like") # null_mask indicates missing values we want to exclude from inference. # This means: only missing values in list-likes (not arrays/ndframes). diff --git a/pandas/core/base.py b/pandas/core/base.py index db81d3e396b50..ca310109ab2e6 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -17,7 +17,6 @@ final, overload, ) -import warnings import numpy as np @@ -38,7 +37,6 @@ cache_readonly, doc, ) -from pandas.util._exceptions import find_stack_level from pandas.core.dtypes.common import ( is_categorical_dtype, @@ -1056,27 +1054,6 @@ def is_unique(self) -> bool: """ return self.nunique(dropna=False) == len(self) - @property - def is_monotonic(self) -> bool: - """ - Return boolean if values in the object are monotonically increasing. - - .. deprecated:: 1.5.0 - is_monotonic is deprecated and will be removed in a future version. - Use is_monotonic_increasing instead. - - Returns - ------- - bool - """ - warnings.warn( - "is_monotonic is deprecated and will be removed in a future version. " - "Use is_monotonic_increasing instead.", - FutureWarning, - stacklevel=find_stack_level(), - ) - return self.is_monotonic_increasing - @property def is_monotonic_increasing(self) -> bool: """ diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index d8300bb29c274..135d6818c7bdd 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -941,34 +941,19 @@ def dtype(self) -> DtypeObj: return self._data.dtype @final - def ravel(self, order: str_t = "C"): + def ravel(self, order: str_t = "C") -> Index: """ - Return an ndarray of the flattened values of the underlying data. + Return a view on self. Returns ------- - numpy.ndarray - Flattened array. + Index See Also -------- numpy.ndarray.ravel : Return a flattened array. """ - warnings.warn( - "Index.ravel returning ndarray is deprecated; in a future version " - "this will return a view on self.", - FutureWarning, - stacklevel=find_stack_level(), - ) - if needs_i8_conversion(self.dtype): - # Item "ndarray[Any, Any]" of "Union[ExtensionArray, ndarray[Any, Any]]" - # has no attribute "_ndarray" - values = self._data._ndarray # type: ignore[union-attr] - elif is_interval_dtype(self.dtype): - values = np.asarray(self._data) - else: - values = self._get_engine_target() - return values.ravel(order=order) + return self[:] def view(self, cls=None): @@ -1555,7 +1540,7 @@ def to_frame( index : bool, default True Set the index of the returned DataFrame as the original Index. - name : object, default None + name : object, defaults to index.name The passed name should substitute for the index name (if it has one). @@ -1597,17 +1582,6 @@ def to_frame( """ from pandas import DataFrame - if name is None: - warnings.warn( - "Explicitly passing `name=None` currently preserves the Index's name " - "or uses a default name of 0. This behaviour is deprecated, and in " - "the future `None` will be used as the name of the resulting " - "DataFrame column.", - FutureWarning, - stacklevel=find_stack_level(), - ) - name = lib.no_default - if name is lib.no_default: name = self._get_level_names() result = DataFrame({name: self._values.copy()}) @@ -2200,24 +2174,6 @@ def _can_hold_na(self) -> bool: return False return True - @final - @property - def is_monotonic(self) -> bool: - """ - Alias for is_monotonic_increasing. - - .. deprecated:: 1.5.0 - is_monotonic is deprecated and will be removed in a future version. - Use is_monotonic_increasing instead. - """ - warnings.warn( - "is_monotonic is deprecated and will be removed in a future version. " - "Use is_monotonic_increasing instead.", - FutureWarning, - stacklevel=find_stack_level(), - ) - return self.is_monotonic_increasing - @property def is_monotonic_increasing(self) -> bool: """ @@ -2629,20 +2585,6 @@ def _is_all_dates(self) -> bool: return False return is_datetime_array(ensure_object(self._values)) - @cache_readonly - @final - def is_all_dates(self) -> bool: - """ - Whether or not the index values only consist of dates. - """ - warnings.warn( - "Index.is_all_dates is deprecated, will be removed in a future version. " - "check index.inferred_type instead.", - FutureWarning, - stacklevel=find_stack_level(), - ) - return self._is_all_dates - @final @cache_readonly def _is_multi(self) -> bool: diff --git a/pandas/core/indexes/category.py b/pandas/core/indexes/category.py index 58b533cb576d9..662e026495631 100644 --- a/pandas/core/indexes/category.py +++ b/pandas/core/indexes/category.py @@ -216,18 +216,8 @@ def __new__( name = maybe_extract_name(name, data, cls) - if data is None: - # GH#38944 - warnings.warn( - "Constructing a CategoricalIndex without passing data is " - "deprecated and will raise in a future version. " - "Use CategoricalIndex([], ...) instead.", - FutureWarning, - stacklevel=find_stack_level(), - ) - data = [] - if is_scalar(data): + # GH#38944 include None here, which pre-2.0 subbed in [] cls._raise_scalar_data_error(data) data = Categorical( diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 3b8380a88bb8b..33f29de1d1a90 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -1738,17 +1738,6 @@ def to_frame( """ from pandas import DataFrame - if name is None: - warnings.warn( - "Explicitly passing `name=None` currently preserves the Index's name " - "or uses a default name of 0. This behaviour is deprecated, and in " - "the future `None` will be used as the name of the resulting " - "DataFrame column.", - FutureWarning, - stacklevel=find_stack_level(), - ) - name = lib.no_default - if name is not lib.no_default: if not is_list_like(name): raise TypeError("'name' must be a list / sequence of column names.") diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index 22406d2871482..ac49cd4cd4330 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -15,7 +15,6 @@ cast, overload, ) -import warnings import numpy as np @@ -42,7 +41,6 @@ Timezone, npt, ) -from pandas.util._exceptions import find_stack_level from pandas.core.dtypes.common import ( ensure_object, @@ -1294,27 +1292,8 @@ def calc_with_mask(carg, mask): return None -def to_time( - arg, - format=None, - infer_time_format: bool = False, - errors: DateTimeErrorChoices = "raise", -): - # GH#34145 - warnings.warn( - "`to_time` has been moved, should be imported from pandas.core.tools.times. " - "This alias will be removed in a future version.", - FutureWarning, - stacklevel=find_stack_level(), - ) - from pandas.core.tools.times import to_time - - return to_time(arg, format, infer_time_format, errors) - - __all__ = [ "DateParseError", "should_cache", "to_datetime", - "to_time", ] diff --git a/pandas/tests/arrays/categorical/test_constructors.py b/pandas/tests/arrays/categorical/test_constructors.py index d11f4648ec632..570f04fae2c33 100644 --- a/pandas/tests/arrays/categorical/test_constructors.py +++ b/pandas/tests/arrays/categorical/test_constructors.py @@ -33,9 +33,9 @@ class TestCategoricalConstructors: - def test_categorical_scalar_deprecated(self): + def test_categorical_disallows_scalar(self): # GH#38433 - with tm.assert_produces_warning(FutureWarning): + with pytest.raises(TypeError, match="Categorical input must be list-like"): Categorical("A", categories=["A", "B"]) def test_categorical_1d_only(self): @@ -220,13 +220,6 @@ def test_constructor(self): assert len(cat.codes) == 1 assert cat.codes[0] == 0 - with tm.assert_produces_warning(FutureWarning): - # GH#38433 - cat = Categorical(1) - assert len(cat.categories) == 1 - assert cat.categories[0] == 1 - assert len(cat.codes) == 1 - assert cat.codes[0] == 0 # two arrays # - when the first is an integer dtype and the second is not # - when the resulting codes are all -1/NaN diff --git a/pandas/tests/indexes/categorical/test_category.py b/pandas/tests/indexes/categorical/test_category.py index 06c00123566ba..e375af797f409 100644 --- a/pandas/tests/indexes/categorical/test_category.py +++ b/pandas/tests/indexes/categorical/test_category.py @@ -38,11 +38,6 @@ def test_can_hold_identifiers(self): key = idx[0] assert idx._can_hold_identifiers_and_holds_name(key) is True - def test_pickle_compat_construction(self): - # Once the deprecation is enforced, we can use the parent class's test - with tm.assert_produces_warning(FutureWarning, match="without passing data"): - self._index_cls() - def test_insert(self, simple_index): ci = simple_index diff --git a/pandas/tests/indexes/categorical/test_constructors.py b/pandas/tests/indexes/categorical/test_constructors.py index def865e03ed7c..19e8ec19db641 100644 --- a/pandas/tests/indexes/categorical/test_constructors.py +++ b/pandas/tests/indexes/categorical/test_constructors.py @@ -11,17 +11,12 @@ class TestCategoricalIndexConstructors: - def test_construction_without_data_deprecated(self): - # Once the deprecation is enforced, we can add this case to - # test_construction_disallows_scalar - msg = "without passing data" - with tm.assert_produces_warning(FutureWarning, match=msg): - CategoricalIndex(categories=list("abcd"), ordered=False) - def test_construction_disallows_scalar(self): msg = "must be called with a collection of some kind" with pytest.raises(TypeError, match=msg): CategoricalIndex(data=1, categories=list("abcd"), ordered=False) + with pytest.raises(TypeError, match=msg): + CategoricalIndex(categories=list("abcd"), ordered=False) def test_construction(self): diff --git a/pandas/tests/indexes/datetimes/methods/test_to_frame.py b/pandas/tests/indexes/datetimes/methods/test_to_frame.py index fa5cca1c3e78b..c829109d4e06c 100644 --- a/pandas/tests/indexes/datetimes/methods/test_to_frame.py +++ b/pandas/tests/indexes/datetimes/methods/test_to_frame.py @@ -19,13 +19,10 @@ def test_to_frame_respects_none_name(self): # not changed to 0 # GH-45448 this is first deprecated to only change in the future idx = date_range(start="2019-01-01", end="2019-01-30", freq="D", tz="UTC") - with tm.assert_produces_warning(FutureWarning): - result = idx.to_frame(name=None) - # exp_idx = Index([None], dtype=object) - exp_idx = Index([0]) + result = idx.to_frame(name=None) + exp_idx = Index([None], dtype=object) tm.assert_index_equal(exp_idx, result.columns) - with tm.assert_produces_warning(FutureWarning): - result = idx.rename("foo").to_frame(name=None) - exp_idx = Index(["foo"], dtype=object) + result = idx.rename("foo").to_frame(name=None) + exp_idx = Index([None], dtype=object) tm.assert_index_equal(exp_idx, result.columns) diff --git a/pandas/tests/indexes/test_any_index.py b/pandas/tests/indexes/test_any_index.py index 6868279776a91..6d4e7caacc5e4 100644 --- a/pandas/tests/indexes/test_any_index.py +++ b/pandas/tests/indexes/test_any_index.py @@ -61,10 +61,10 @@ def test_view_preserves_name(index): assert index.view().name == index.name -def test_ravel_deprecation(index): - # GH#19956 ravel returning ndarray is deprecated - with tm.assert_produces_warning(FutureWarning): - index.ravel() +def test_ravel(index): + # GH#19956 ravel returning ndarray is deprecated, in 2.0 returns a view on self + res = index.ravel() + tm.assert_index_equal(res, index) class TestConversion: diff --git a/pandas/tests/indexes/test_base.py b/pandas/tests/indexes/test_base.py index 523decba33b6e..60cf3365fc7de 100644 --- a/pandas/tests/indexes/test_base.py +++ b/pandas/tests/indexes/test_base.py @@ -664,23 +664,6 @@ def test_is_numeric(self, index, expected): def test_is_object(self, index, expected): assert index.is_object() is expected - @pytest.mark.parametrize( - "index, expected", - [ - ("string", False), - ("bool-object", False), - ("bool-dtype", False), - ("categorical", False), - ("int", False), - ("datetime", True), - ("float", False), - ], - indirect=["index"], - ) - def test_is_all_dates(self, index, expected): - with tm.assert_produces_warning(FutureWarning): - assert index.is_all_dates is expected - def test_summary(self, index): index._summary() diff --git a/pandas/tests/series/test_api.py b/pandas/tests/series/test_api.py index 5214e280718f0..4be0aa15523fb 100644 --- a/pandas/tests/series/test_api.py +++ b/pandas/tests/series/test_api.py @@ -171,9 +171,7 @@ def test_attrs(self): def test_inspect_getmembers(self): # GH38782 ser = Series(dtype=object) - # TODO(2.0): Change to None once is_monotonic deprecation - # is enforced - with tm.assert_produces_warning(FutureWarning, check_stacklevel=False): + with tm.assert_produces_warning(None, check_stacklevel=False): inspect.getmembers(ser) def test_unknown_attribute(self): diff --git a/pandas/tests/series/test_constructors.py b/pandas/tests/series/test_constructors.py index 1ab04daca60b7..39767e5c8f226 100644 --- a/pandas/tests/series/test_constructors.py +++ b/pandas/tests/series/test_constructors.py @@ -1965,8 +1965,6 @@ class TestSeriesConstructorIndexCoercion: def test_series_constructor_datetimelike_index_coercion(self): idx = tm.makeDateIndex(10000) ser = Series(np.random.randn(len(idx)), idx.astype(object)) - with tm.assert_produces_warning(FutureWarning): - assert ser.index.is_all_dates # as of 2.0, we no longer silently cast the object-dtype index # to DatetimeIndex GH#39307, GH#23598 assert not isinstance(ser.index, DatetimeIndex) diff --git a/pandas/tests/tools/test_to_time.py b/pandas/tests/tools/test_to_time.py index c80b1e080a1d1..5046fd9d0edc1 100644 --- a/pandas/tests/tools/test_to_time.py +++ b/pandas/tests/tools/test_to_time.py @@ -8,7 +8,6 @@ from pandas import Series import pandas._testing as tm -from pandas.core.tools.datetimes import to_time as to_time_alias from pandas.core.tools.times import to_time # The tests marked with this are locale-dependent. @@ -69,12 +68,3 @@ def test_arraylike(self): res = to_time(np.array(arg)) assert isinstance(res, list) assert res == expected_arr - - -def test_to_time_alias(): - expected = time(14, 15) - - with tm.assert_produces_warning(FutureWarning): - result = to_time_alias(expected) - - assert result == expected From aafa00cafc16809d2906b8f2a316fee2897766ad Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 1 Nov 2022 19:44:04 -0700 Subject: [PATCH 2/3] update doc --- doc/redirects.csv | 2 -- doc/source/reference/indexing.rst | 1 - doc/source/reference/series.rst | 1 - 3 files changed, 4 deletions(-) diff --git a/doc/redirects.csv b/doc/redirects.csv index 8c89d1ea0aef3..f0fab09196f26 100644 --- a/doc/redirects.csv +++ b/doc/redirects.csv @@ -670,7 +670,6 @@ generated/pandas.Index.is_integer,../reference/api/pandas.Index.is_integer generated/pandas.Index.is_interval,../reference/api/pandas.Index.is_interval generated/pandas.Index.is_lexsorted_for_tuple,../reference/api/pandas.Index.is_lexsorted_for_tuple generated/pandas.Index.is_monotonic_decreasing,../reference/api/pandas.Index.is_monotonic_decreasing -generated/pandas.Index.is_monotonic,../reference/api/pandas.Index.is_monotonic generated/pandas.Index.is_monotonic_increasing,../reference/api/pandas.Index.is_monotonic_increasing generated/pandas.Index.isna,../reference/api/pandas.Index.isna generated/pandas.Index.isnull,../reference/api/pandas.Index.isnull @@ -1067,7 +1066,6 @@ generated/pandas.Series.interpolate,../reference/api/pandas.Series.interpolate generated/pandas.Series.is_copy,../reference/api/pandas.Series.is_copy generated/pandas.Series.isin,../reference/api/pandas.Series.isin generated/pandas.Series.is_monotonic_decreasing,../reference/api/pandas.Series.is_monotonic_decreasing -generated/pandas.Series.is_monotonic,../reference/api/pandas.Series.is_monotonic generated/pandas.Series.is_monotonic_increasing,../reference/api/pandas.Series.is_monotonic_increasing generated/pandas.Series.isna,../reference/api/pandas.Series.isna generated/pandas.Series.isnull,../reference/api/pandas.Series.isnull diff --git a/doc/source/reference/indexing.rst b/doc/source/reference/indexing.rst index ea1781955eeaa..81148b4a29df5 100644 --- a/doc/source/reference/indexing.rst +++ b/doc/source/reference/indexing.rst @@ -25,7 +25,6 @@ Properties :toctree: api/ Index.values - Index.is_monotonic Index.is_monotonic_increasing Index.is_monotonic_decreasing Index.is_unique diff --git a/doc/source/reference/series.rst b/doc/source/reference/series.rst index c9604f48dd334..c8bbe922f5313 100644 --- a/doc/source/reference/series.rst +++ b/doc/source/reference/series.rst @@ -167,7 +167,6 @@ Computations / descriptive stats Series.unique Series.nunique Series.is_unique - Series.is_monotonic Series.is_monotonic_increasing Series.is_monotonic_decreasing Series.value_counts From a2b52189d884a7f5046252eb3e5b960e7c3d5f9f Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Wed, 2 Nov 2022 11:49:14 -0700 Subject: [PATCH 3/3] Update doc/source/whatsnew/v2.0.0.rst Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> --- doc/source/whatsnew/v2.0.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index 8830e8d972e63..f7b4b20ddba22 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -248,7 +248,7 @@ Removal of prior version deprecations/changes - Disallow passing non-keyword arguments to :meth:`DataFrame.replace`, :meth:`Series.replace` except for ``to_replace`` and ``value`` (:issue:`47587`) - Disallow passing non-keyword arguments to :meth:`DataFrame.sort_values` except for ``by`` (:issue:`41505`) - Disallow passing non-keyword arguments to :meth:`Series.sort_values` (:issue:`41505`) -- Disallowed constructing :class:`Categorical` without scalar ``data`` (:issue:`38433`) +- Disallowed constructing :class:`Categorical` with scalar ``data`` (:issue:`38433`) - Disallowed constructing :class:`CategoricalIndex` without passing ``data`` (:issue:`38944`) - Removed :meth:`.Rolling.validate`, :meth:`.Expanding.validate`, and :meth:`.ExponentialMovingWindow.validate` (:issue:`43665`) - Removed :attr:`Rolling.win_type` returning ``"freq"`` (:issue:`38963`)