From 188da3d582dadfc5f755ebf9d111e784267d74e1 Mon Sep 17 00:00:00 2001 From: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com> Date: Sat, 4 May 2024 00:47:33 +0300 Subject: [PATCH 1/2] DOC: Improve convert_dtypes's docstring --- pandas/core/generic.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 24727bb9d83c1..421e7f1a71c31 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6622,7 +6622,8 @@ def convert_dtypes( dtype_backend: DtypeBackend = "numpy_nullable", ) -> Self: """ - Convert columns to the best possible dtypes using dtypes supporting ``pd.NA``. + Convert columns from numpy dtypes to the best possible dtypes that support + ``pd.NA``. Parameters ---------- @@ -6639,13 +6640,13 @@ def convert_dtypes( If `convert_integer` is also True, preference will be give to integer dtypes if the floats can be faithfully casted to integers. dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' - Back-end data type applied to the resultant :class:`DataFrame` - (still experimental). Behaviour is as follows: + Back-end data type applied to the resultant :class:`DataFrame` or + :class:`Series` (still experimental). Behaviour is as follows: * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame` - (default). + or :class:`Series` (default). * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` - DataFrame. + DataFrame or Series. .. versionadded:: 2.0 From 92b5150cc71873e7d941bdc1f2b9817f0d061736 Mon Sep 17 00:00:00 2001 From: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com> Date: Sat, 4 May 2024 01:25:35 +0300 Subject: [PATCH 2/2] Make summary 1 line --- pandas/core/generic.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 421e7f1a71c31..20d8bd3bda21f 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6622,8 +6622,7 @@ def convert_dtypes( dtype_backend: DtypeBackend = "numpy_nullable", ) -> Self: """ - Convert columns from numpy dtypes to the best possible dtypes that support - ``pd.NA``. + Convert columns from numpy dtypes to the best dtypes that support ``pd.NA``. Parameters ----------