Skip to content

DOC: move convert_dtypes whatsnew to 1.0 #31279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions doc/source/whatsnew/v1.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,36 @@ You can use the alias ``"boolean"`` as well.
s = pd.Series([True, False, None], dtype="boolean")
s

.. _whatsnew_100.convert_dtypes:

``convert_dtypes`` method to ease use of supported extension dtypes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In order to encourage use of the extension dtypes ``StringDtype``,
``BooleanDtype``, ``Int64Dtype``, ``Int32Dtype``, etc., that support ``pd.NA``, the
methods :meth:`DataFrame.convert_dtypes` and :meth:`Series.convert_dtypes`
have been introduced. (:issue:`29752`) (:issue:`30929`)

Example:

.. ipython:: python

df = pd.DataFrame({'x': ['abc', None, 'def'],
'y': [1, 2, np.nan],
'z': [True, False, True]})
df
df.dtypes

.. ipython:: python

converted = df.convert_dtypes()
converted
converted.dtypes

This is especially useful after reading in data using readers such as :func:`read_csv`
and :func:`read_excel`.
See :ref:`here <missing_data.NA.conversion>` for a description.

.. _whatsnew_100.numba_rolling_apply:

Using Numba in ``rolling.apply`` and ``expanding.apply``
Expand Down
30 changes: 0 additions & 30 deletions doc/source/whatsnew/v1.1.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,6 @@ including other versions of pandas.
Enhancements
~~~~~~~~~~~~

.. _whatsnew_100.convert_dtypes:

``convert_dtypes`` method to ease use of supported extension dtypes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In order to encourage use of the extension dtypes ``StringDtype``,
``BooleanDtype``, ``Int64Dtype``, ``Int32Dtype``, etc., that support ``pd.NA``, the
methods :meth:`DataFrame.convert_dtypes` and :meth:`Series.convert_dtypes`
have been introduced. (:issue:`29752`) (:issue:`30929`)

Example:

.. ipython:: python

df = pd.DataFrame({'x': ['abc', None, 'def'],
'y': [1, 2, np.nan],
'z': [True, False, True]})
df
df.dtypes

.. ipython:: python

converted = df.convert_dtypes()
converted
converted.dtypes

This is especially useful after reading in data using readers such as :func:`read_csv`
and :func:`read_excel`.
See :ref:`here <missing_data.NA.conversion>` for a description.

.. _whatsnew_110.period_index_partial_string_slicing:

Nonmonotonic PeriodIndex Partial String Slicing
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5741,7 +5741,7 @@ def convert_dtypes(
"""
Convert columns to best possible dtypes using dtypes supporting ``pd.NA``.

.. versionadded:: 1.1.0
.. versionadded:: 1.0.0

Parameters
----------
Expand Down