Skip to content

Commit 4b27e94

Browse files
authored
Update multiple instances of dtype_backend parameter description to make them all consistent (#54104)
update dtype_backend description instances so that they are all the same
1 parent 0511c49 commit 4b27e94

File tree

14 files changed

+140
-119
lines changed

14 files changed

+140
-119
lines changed

pandas/core/dtypes/cast.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,11 +1004,16 @@ def convert_dtypes(
10041004
infer_objects : bool, defaults False
10051005
Whether to also infer objects to float/int if possible. Is only hit if the
10061006
object array contains pd.NA.
1007-
dtype_backend : str, default "numpy_nullable"
1008-
Nullable dtype implementation to use.
1007+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
1008+
Back-end data type applied to the resultant :class:`DataFrame`
1009+
(still experimental). Behaviour is as follows:
10091010
1010-
* "numpy_nullable" returns numpy-backed nullable types
1011-
* "pyarrow" returns pyarrow-backed nullable types using ``ArrowDtype``
1011+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
1012+
(default).
1013+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
1014+
DataFrame.
1015+
1016+
.. versionadded:: 2.0
10121017
10131018
Returns
10141019
-------

pandas/core/generic.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6737,13 +6737,14 @@ def convert_dtypes(
67376737
dtypes if the floats can be faithfully casted to integers.
67386738
67396739
.. versionadded:: 1.2.0
6740-
dtype_backend : {"numpy_nullable", "pyarrow"}, default "numpy_nullable"
6741-
Which dtype_backend to use, e.g. whether a DataFrame should use nullable
6742-
dtypes for all dtypes that have a nullable
6743-
implementation when "numpy_nullable" is set, pyarrow is used for all
6744-
dtypes if "pyarrow" is set.
6745-
6746-
The dtype_backends are still experimential.
6740+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
6741+
Back-end data type applied to the resultant :class:`DataFrame`
6742+
(still experimental). Behaviour is as follows:
6743+
6744+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
6745+
(default).
6746+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
6747+
DataFrame.
67476748
67486749
.. versionadded:: 2.0
67496750

pandas/core/tools/numeric.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,14 @@ def to_numeric(
8888
the dtype it is to be cast to, so if none of the dtypes
8989
checked satisfy that specification, no downcasting will be
9090
performed on the data.
91-
dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFrames
92-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
93-
arrays, nullable dtypes are used for all dtypes that have a nullable
94-
implementation when "numpy_nullable" is set, pyarrow is used for all
95-
dtypes if "pyarrow" is set.
96-
97-
The dtype_backends are still experimential.
91+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
92+
Back-end data type applied to the resultant :class:`DataFrame`
93+
(still experimental). Behaviour is as follows:
94+
95+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
96+
(default).
97+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
98+
DataFrame.
9899
99100
.. versionadded:: 2.0
100101

pandas/io/clipboards.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ def read_clipboard(
3737
A string or regex delimiter. The default of ``'\\s+'`` denotes
3838
one or more whitespace characters.
3939
40-
dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFrames
41-
Which dtype_backend to use, e.g., whether a DataFrame should have NumPy
42-
arrays, nullable dtypes are used for all dtypes that have a nullable
43-
implementation when ``'numpy_nullable'`` is set, pyarrow is used for all
44-
dtypes if ``'pyarrow'`` is set.
45-
46-
The dtype_backends are still experimental.
40+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
41+
Back-end data type applied to the resultant :class:`DataFrame`
42+
(still experimental). Behaviour is as follows:
43+
44+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
45+
(default).
46+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
47+
DataFrame.
4748
4849
.. versionadded:: 2.0
4950

pandas/io/excel/_base.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,14 @@
286286
287287
.. versionadded:: 1.2.0
288288
289-
dtype_backend : {{"numpy_nullable", "pyarrow"}}, defaults to NumPy backed DataFrames
290-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
291-
arrays, nullable dtypes are used for all dtypes that have a nullable
292-
implementation when "numpy_nullable" is set, pyarrow is used for all
293-
dtypes if "pyarrow" is set.
294-
295-
The dtype_backends are still experimential.
289+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
290+
Back-end data type applied to the resultant :class:`DataFrame`
291+
(still experimental). Behaviour is as follows:
292+
293+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
294+
(default).
295+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
296+
DataFrame.
296297
297298
.. versionadded:: 2.0
298299

pandas/io/feather_format.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,14 @@ def read_feather(
8989
9090
.. versionadded:: 1.2.0
9191
92-
dtype_backend : {{"numpy_nullable", "pyarrow"}}, defaults to NumPy backed DataFrames
93-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
94-
arrays, nullable dtypes are used for all dtypes that have a nullable
95-
implementation when "numpy_nullable" is set, pyarrow is used for all
96-
dtypes if "pyarrow" is set.
97-
98-
The dtype_backends are still experimential.
92+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
93+
Back-end data type applied to the resultant :class:`DataFrame`
94+
(still experimental). Behaviour is as follows:
95+
96+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
97+
(default).
98+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
99+
DataFrame.
99100
100101
.. versionadded:: 2.0
101102

pandas/io/html.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,13 +1121,14 @@ def read_html(
11211121
11221122
.. versionadded:: 1.5.0
11231123
1124-
dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFrames
1125-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
1126-
arrays, nullable dtypes are used for all dtypes that have a nullable
1127-
implementation when "numpy_nullable" is set, pyarrow is used for all
1128-
dtypes if "pyarrow" is set.
1129-
1130-
The dtype_backends are still experimential.
1124+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
1125+
Back-end data type applied to the resultant :class:`DataFrame`
1126+
(still experimental). Behaviour is as follows:
1127+
1128+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
1129+
(default).
1130+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
1131+
DataFrame.
11311132
11321133
.. versionadded:: 2.0
11331134

pandas/io/json/_json.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -662,13 +662,14 @@ def read_json(
662662
663663
.. versionadded:: 1.2.0
664664
665-
dtype_backend : {{"numpy_nullable", "pyarrow"}}, defaults to NumPy backed DataFrames
666-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
667-
arrays, nullable dtypes are used for all dtypes that have a nullable
668-
implementation when "numpy_nullable" is set, pyarrow is used for all
669-
dtypes if "pyarrow" is set.
670-
671-
The dtype_backends are still experimential.
665+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
666+
Back-end data type applied to the resultant :class:`DataFrame`
667+
(still experimental). Behaviour is as follows:
668+
669+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
670+
(default).
671+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
672+
DataFrame.
672673
673674
.. versionadded:: 2.0
674675

pandas/io/orc.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ def read_orc(
6363
Output always follows the ordering of the file and not the columns list.
6464
This mirrors the original behaviour of
6565
:external+pyarrow:py:meth:`pyarrow.orc.ORCFile.read`.
66-
dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFrames
67-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
68-
arrays, nullable dtypes are used for all dtypes that have a nullable
69-
implementation when "numpy_nullable" is set, pyarrow is used for all
70-
dtypes if "pyarrow" is set.
71-
72-
The dtype_backends are still experimential.
66+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
67+
Back-end data type applied to the resultant :class:`DataFrame`
68+
(still experimental). Behaviour is as follows:
69+
70+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
71+
(default).
72+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
73+
DataFrame.
7374
7475
.. versionadded:: 2.0
7576

pandas/io/parquet.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -533,13 +533,14 @@ def read_parquet(
533533
534534
.. deprecated:: 2.0
535535
536-
dtype_backend : {{"numpy_nullable", "pyarrow"}}, defaults to NumPy backed DataFrames
537-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
538-
arrays, nullable dtypes are used for all dtypes that have a nullable
539-
implementation when "numpy_nullable" is set, pyarrow is used for all
540-
dtypes if "pyarrow" is set.
541-
542-
The dtype_backends are still experimential.
536+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
537+
Back-end data type applied to the resultant :class:`DataFrame`
538+
(still experimental). Behaviour is as follows:
539+
540+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
541+
(default).
542+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
543+
DataFrame.
543544
544545
.. versionadded:: 2.0
545546

0 commit comments

Comments
 (0)