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

+9-4
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

+8-7
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

+8-7
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

+8-7
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

+8-7
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

+8-7
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

+8-7
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

+8-7
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

+8-7
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

+8-7
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

pandas/io/parsers/readers.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -416,14 +416,14 @@
416416
417417
.. versionadded:: 1.2
418418
419-
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, defaults to NumPy backed DataFrame
420-
Back-end data type to use for the :class:`~pandas.DataFrame`. For
421-
``'numpy_nullable'``, have NumPy arrays, nullable ``dtypes`` are used for all
422-
``dtypes`` that have a
423-
nullable implementation when ``'numpy_nullable'`` is set, pyarrow is used for all
424-
dtypes if ``'pyarrow'`` is set.
419+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
420+
Back-end data type applied to the resultant :class:`DataFrame`
421+
(still experimental). Behaviour is as follows:
425422
426-
The ``dtype_backends`` are still experimental.
423+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
424+
(default).
425+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
426+
DataFrame.
427427
428428
.. versionadded:: 2.0
429429
@@ -1319,13 +1319,14 @@ def read_fwf(
13191319
infer_nrows : int, default 100
13201320
The number of rows to consider when letting the parser determine the
13211321
`colspecs`.
1322-
dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFrames
1323-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
1324-
arrays, nullable dtypes are used for all dtypes that have a nullable
1325-
implementation when "numpy_nullable" is set, pyarrow is used for all
1326-
dtypes if "pyarrow" is set.
1327-
1328-
The dtype_backends are still experimential.
1322+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
1323+
Back-end data type applied to the resultant :class:`DataFrame`
1324+
(still experimental). Behaviour is as follows:
1325+
1326+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
1327+
(default).
1328+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
1329+
DataFrame.
13291330
13301331
.. versionadded:: 2.0
13311332

pandas/io/spss.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ def read_spss(
3636
Return a subset of the columns. If None, return all columns.
3737
convert_categoricals : bool, default is True
3838
Convert categorical columns into pd.Categorical.
39-
dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFrames
40-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
41-
arrays, nullable dtypes are used for all dtypes that have a nullable
42-
implementation when "numpy_nullable" is set, pyarrow is used for all
43-
dtypes if "pyarrow" is set.
39+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
40+
Back-end data type applied to the resultant :class:`DataFrame`
41+
(still experimental). Behaviour is as follows:
4442
45-
The dtype_backends are still experimential.
43+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
44+
(default).
45+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
46+
DataFrame.
4647
4748
.. versionadded:: 2.0
4849

pandas/io/sql.py

+29-25
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,14 @@ def read_sql_table(
305305
chunksize : int, default None
306306
If specified, returns an iterator where `chunksize` is the number of
307307
rows to include in each chunk.
308-
dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFrames
309-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
310-
arrays, nullable dtypes are used for all dtypes that have a nullable
311-
implementation when "numpy_nullable" is set, pyarrow is used for all
312-
dtypes if "pyarrow" is set.
308+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
309+
Back-end data type applied to the resultant :class:`DataFrame`
310+
(still experimental). Behaviour is as follows:
313311
314-
The dtype_backends are still experimential.
312+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
313+
(default).
314+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
315+
DataFrame.
315316
316317
.. versionadded:: 2.0
317318
@@ -443,13 +444,14 @@ def read_sql_query(
443444
{‘a’: np.float64, ‘b’: np.int32, ‘c’: ‘Int64’}.
444445
445446
.. versionadded:: 1.3.0
446-
dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFrames
447-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
448-
arrays, nullable dtypes are used for all dtypes that have a nullable
449-
implementation when "numpy_nullable" is set, pyarrow is used for all
450-
dtypes if "pyarrow" is set.
447+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
448+
Back-end data type applied to the resultant :class:`DataFrame`
449+
(still experimental). Behaviour is as follows:
451450
452-
The dtype_backends are still experimential.
451+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
452+
(default).
453+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
454+
DataFrame.
453455
454456
.. versionadded:: 2.0
455457
@@ -576,13 +578,14 @@ def read_sql(
576578
chunksize : int, default None
577579
If specified, return an iterator where `chunksize` is the
578580
number of rows to include in each chunk.
579-
dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFrames
580-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
581-
arrays, nullable dtypes are used for all dtypes that have a nullable
582-
implementation when "numpy_nullable" is set, pyarrow is used for all
583-
dtypes if "pyarrow" is set.
581+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
582+
Back-end data type applied to the resultant :class:`DataFrame`
583+
(still experimental). Behaviour is as follows:
584584
585-
The dtype_backends are still experimential.
585+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
586+
(default).
587+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
588+
DataFrame.
586589
587590
.. versionadded:: 2.0
588591
dtype : Type name or dict of columns
@@ -1631,13 +1634,14 @@ def read_table(
16311634
chunksize : int, default None
16321635
If specified, return an iterator where `chunksize` is the number
16331636
of rows to include in each chunk.
1634-
dtype_backend : {{"numpy_nullable", "pyarrow"}}, defaults to NumPy dtypes
1635-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
1636-
arrays, nullable dtypes are used for all dtypes that have a nullable
1637-
implementation when "numpy_nullable" is set, pyarrow is used for all
1638-
dtypes if "pyarrow" is set.
1639-
1640-
The dtype_backends are still experimential.
1637+
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
1638+
Back-end data type applied to the resultant :class:`DataFrame`
1639+
(still experimental). Behaviour is as follows:
1640+
1641+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
1642+
(default).
1643+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
1644+
DataFrame.
16411645
16421646
.. versionadded:: 2.0
16431647

pandas/io/xml.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -1014,13 +1014,14 @@ def read_xml(
10141014
10151015
{storage_options}
10161016
1017-
dtype_backend : {{"numpy_nullable", "pyarrow"}}, defaults to NumPy backed DataFrames
1018-
Which dtype_backend to use, e.g. whether a DataFrame should have NumPy
1019-
arrays, nullable dtypes are used for all dtypes that have a nullable
1020-
implementation when "numpy_nullable" is set, pyarrow is used for all
1021-
dtypes if "pyarrow" is set.
1022-
1023-
The dtype_backends are still experimential.
1017+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
1018+
Back-end data type applied to the resultant :class:`DataFrame`
1019+
(still experimental). Behaviour is as follows:
1020+
1021+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
1022+
(default).
1023+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
1024+
DataFrame.
10241025
10251026
.. versionadded:: 2.0
10261027

0 commit comments

Comments
 (0)