Skip to content

Commit

Permalink
DOC: Move deprecation note (pandas-dev#56593)
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl authored Dec 22, 2023
1 parent 69ee05f commit 0d8a0f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doc/source/whatsnew/v2.2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,18 @@ These methods are:
- :meth:`DataFrame.fillna`, :meth:`Series.fillna`
- :meth:`DataFrame.ffill`, :meth:`Series.ffill`
- :meth:`DataFrame.bfill`, :meth:`Series.bfill`
- :meth:`DataFrame.mask`, :meth:`Series.mask`
- :meth:`DataFrame.where`, :meth:`Series.where`
- :meth:`DataFrame.clip`, :meth:`Series.clip`

Explicitly call :meth:`DataFrame.infer_objects` to replicate the current behavior in the future.

.. code-block:: ipython
result = result.infer_objects(copy=False)
Or explicitly cast all-round floats to ints using ``astype``.

Set the following option to opt into the future behavior:

.. code-block:: ipython
Expand Down Expand Up @@ -618,7 +623,6 @@ Other Deprecations
- Deprecated allowing passing :class:`BlockManager` objects to :class:`DataFrame` or :class:`SingleBlockManager` objects to :class:`Series` (:issue:`52419`)
- Deprecated behavior of :meth:`Index.insert` with an object-dtype index silently performing type inference on the result, explicitly call ``result.infer_objects(copy=False)`` for the old behavior instead (:issue:`51363`)
- Deprecated casting non-datetimelike values (mainly strings) in :meth:`Series.isin` and :meth:`Index.isin` with ``datetime64``, ``timedelta64``, and :class:`PeriodDtype` dtypes (:issue:`53111`)
- Deprecated downcasting behavior in :meth:`Series.where`, :meth:`DataFrame.where`, :meth:`Series.mask`, :meth:`DataFrame.mask`, :meth:`Series.clip`, :meth:`DataFrame.clip`; in a future version these will not infer object-dtype columns to non-object dtype, or all-round floats to integer dtype. Call ``result.infer_objects(copy=False)`` on the result for object inference, or explicitly cast floats to ints. To opt in to the future version, use ``pd.set_option("future.no_silent_downcasting", True)`` (:issue:`53656`)
- Deprecated dtype inference in :class:`Index`, :class:`Series` and :class:`DataFrame` constructors when giving a pandas input, call ``.infer_objects`` on the input to keep the current behavior (:issue:`56012`)
- Deprecated dtype inference when setting a :class:`Index` into a :class:`DataFrame`, cast explicitly instead (:issue:`56102`)
- Deprecated including the groups in computations when using :meth:`.DataFrameGroupBy.apply` and :meth:`.DataFrameGroupBy.resample`; pass ``include_groups=False`` to exclude the groups (:issue:`7155`)
Expand Down

0 comments on commit 0d8a0f3

Please sign in to comment.