Skip to content

Commit 79f3b4c

Browse files
Dr-Irvjorisvandenbossche
authored andcommitted
DOC: move convert_dtypes whatsnew to 1.0 (#31279)
1 parent b1a104e commit 79f3b4c

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

doc/source/whatsnew/v1.0.0.rst

+30
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,36 @@ You can use the alias ``"boolean"`` as well.
157157
s = pd.Series([True, False, None], dtype="boolean")
158158
s
159159
160+
.. _whatsnew_100.convert_dtypes:
161+
162+
``convert_dtypes`` method to ease use of supported extension dtypes
163+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
164+
165+
In order to encourage use of the extension dtypes ``StringDtype``,
166+
``BooleanDtype``, ``Int64Dtype``, ``Int32Dtype``, etc., that support ``pd.NA``, the
167+
methods :meth:`DataFrame.convert_dtypes` and :meth:`Series.convert_dtypes`
168+
have been introduced. (:issue:`29752`) (:issue:`30929`)
169+
170+
Example:
171+
172+
.. ipython:: python
173+
174+
df = pd.DataFrame({'x': ['abc', None, 'def'],
175+
'y': [1, 2, np.nan],
176+
'z': [True, False, True]})
177+
df
178+
df.dtypes
179+
180+
.. ipython:: python
181+
182+
converted = df.convert_dtypes()
183+
converted
184+
converted.dtypes
185+
186+
This is especially useful after reading in data using readers such as :func:`read_csv`
187+
and :func:`read_excel`.
188+
See :ref:`here <missing_data.NA.conversion>` for a description.
189+
160190
.. _whatsnew_100.numba_rolling_apply:
161191

162192
Using Numba in ``rolling.apply`` and ``expanding.apply``

doc/source/whatsnew/v1.1.0.rst

-30
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,6 @@ including other versions of pandas.
1313
Enhancements
1414
~~~~~~~~~~~~
1515

16-
.. _whatsnew_100.convert_dtypes:
17-
18-
``convert_dtypes`` method to ease use of supported extension dtypes
19-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20-
21-
In order to encourage use of the extension dtypes ``StringDtype``,
22-
``BooleanDtype``, ``Int64Dtype``, ``Int32Dtype``, etc., that support ``pd.NA``, the
23-
methods :meth:`DataFrame.convert_dtypes` and :meth:`Series.convert_dtypes`
24-
have been introduced. (:issue:`29752`) (:issue:`30929`)
25-
26-
Example:
27-
28-
.. ipython:: python
29-
30-
df = pd.DataFrame({'x': ['abc', None, 'def'],
31-
'y': [1, 2, np.nan],
32-
'z': [True, False, True]})
33-
df
34-
df.dtypes
35-
36-
.. ipython:: python
37-
38-
converted = df.convert_dtypes()
39-
converted
40-
converted.dtypes
41-
42-
This is especially useful after reading in data using readers such as :func:`read_csv`
43-
and :func:`read_excel`.
44-
See :ref:`here <missing_data.NA.conversion>` for a description.
45-
4616
.. _whatsnew_110.period_index_partial_string_slicing:
4717

4818
Nonmonotonic PeriodIndex Partial String Slicing

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5741,7 +5741,7 @@ def convert_dtypes(
57415741
"""
57425742
Convert columns to best possible dtypes using dtypes supporting ``pd.NA``.
57435743
5744-
.. versionadded:: 1.1.0
5744+
.. versionadded:: 1.0.0
57455745
57465746
Parameters
57475747
----------

0 commit comments

Comments
 (0)