Skip to content

Commit a3f2d48

Browse files
authored
DOC: More doc fix for dtype_backend (#59071)
1 parent 4cb55e5 commit a3f2d48

File tree

14 files changed

+102
-89
lines changed

14 files changed

+102
-89
lines changed

pandas/core/dtypes/cast.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1014,10 +1014,8 @@ def convert_dtypes(
10141014
Back-end data type applied to the resultant :class:`DataFrame`
10151015
(still experimental). Behaviour is as follows:
10161016
1017-
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
1018-
(default).
1017+
* ``"numpy_nullable"``: returns nullable-dtype
10191018
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
1020-
DataFrame.
10211019
10221020
.. versionadded:: 2.0
10231021

pandas/core/generic.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -6670,10 +6670,10 @@ def convert_dtypes(
66706670
Back-end data type applied to the resultant :class:`DataFrame` or
66716671
:class:`Series` (still experimental). Behaviour is as follows:
66726672
6673-
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
6674-
or :class:`Series` (default).
6673+
* ``"numpy_nullable"``: returns nullable-dtype-backed
6674+
:class:`DataFrame` or :class:`Serires`.
66756675
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
6676-
DataFrame or Series.
6676+
:class:`DataFrame` or :class:`Series`.
66776677
66786678
.. versionadded:: 2.0
66796679

pandas/core/tools/numeric.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ def to_numeric(
9999
is to not use nullable data types. If specified, the behavior
100100
is as follows:
101101
102-
* ``"numpy_nullable"``: returns with nullable-dtype-backed
103-
* ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype`
102+
* ``"numpy_nullable"``: returns nullable-dtype-backed object
103+
* ``"pyarrow"``: returns with pyarrow-backed nullable object
104104
105105
.. versionadded:: 2.0
106106

pandas/io/clipboards.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@ def read_clipboard(
3838
A string or regex delimiter. The default of ``'\\s+'`` denotes
3939
one or more whitespace characters.
4040
41-
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
41+
dtype_backend : {'numpy_nullable', 'pyarrow'}
4242
Back-end data type applied to the resultant :class:`DataFrame`
43-
(still experimental). Behaviour is as follows:
43+
(still experimental). If not specified, the default behavior
44+
is to not use nullable data types. If specified, the behavior
45+
is as follows:
4446
4547
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
46-
(default).
47-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
48-
DataFrame.
48+
* ``"pyarrow"``: returns pyarrow-backed nullable
49+
:class:`ArrowDtype` :class:`DataFrame`
4950
5051
.. versionadded:: 2.0
5152

pandas/io/excel/_base.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,15 @@
267267
Rows at the end to skip (0-indexed).
268268
{storage_options}
269269
270-
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
270+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
271271
Back-end data type applied to the resultant :class:`DataFrame`
272-
(still experimental). Behaviour is as follows:
272+
(still experimental). If not specified, the default behavior
273+
is to not use nullable data types. If specified, the behavior
274+
is as follows:
273275
274276
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
275-
(default).
276-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
277-
DataFrame.
277+
* ``"pyarrow"``: returns pyarrow-backed nullable
278+
:class:`ArrowDtype` :class:`DataFrame`
278279
279280
.. versionadded:: 2.0
280281
@@ -1728,14 +1729,15 @@ def parse(
17281729
comment string and the end of the current line is ignored.
17291730
skipfooter : int, default 0
17301731
Rows at the end to skip (0-indexed).
1731-
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
1732+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
17321733
Back-end data type applied to the resultant :class:`DataFrame`
1733-
(still experimental). Behaviour is as follows:
1734+
(still experimental). If not specified, the default behavior
1735+
is to not use nullable data types. If specified, the behavior
1736+
is as follows:
17341737
17351738
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
1736-
(default).
1737-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
1738-
DataFrame.
1739+
* ``"pyarrow"``: returns pyarrow-backed nullable
1740+
:class:`ArrowDtype` :class:`DataFrame`
17391741
17401742
.. versionadded:: 2.0
17411743
**kwds : dict, optional

pandas/io/feather_format.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,15 @@ def read_feather(
9292
Whether to parallelize reading using multiple threads.
9393
{storage_options}
9494
95-
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
95+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
9696
Back-end data type applied to the resultant :class:`DataFrame`
97-
(still experimental). Behaviour is as follows:
97+
(still experimental). If not specified, the default behavior
98+
is to not use nullable data types. If specified, the behavior
99+
is as follows:
98100
99-
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
100-
(default).
101-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
102-
DataFrame.
101+
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`.
102+
* ``"pyarrow"``: returns pyarrow-backed nullable
103+
:class:`ArrowDtype` :class:`DataFrame`
103104
104105
.. versionadded:: 2.0
105106

pandas/io/html.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1131,14 +1131,15 @@ def read_html(
11311131
11321132
.. versionadded:: 1.5.0
11331133
1134-
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
1134+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
11351135
Back-end data type applied to the resultant :class:`DataFrame`
1136-
(still experimental). Behaviour is as follows:
1136+
(still experimental). If not specified, the default behavior
1137+
is to not use nullable data types. If specified, the behavior
1138+
is as follows:
11371139
11381140
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
1139-
(default).
1140-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
1141-
DataFrame.
1141+
* ``"pyarrow"``: returns pyarrow-backed nullable
1142+
:class:`ArrowDtype` :class:`DataFrame`
11421143
11431144
.. versionadded:: 2.0
11441145

pandas/io/json/_json.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -652,14 +652,15 @@ def read_json(
652652
653653
{storage_options}
654654
655-
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
655+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
656656
Back-end data type applied to the resultant :class:`DataFrame`
657-
(still experimental). Behaviour is as follows:
657+
(still experimental). If not specified, the default behavior
658+
is to not use nullable data types. If specified, the behavior
659+
is as follows:
658660
659661
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
660-
(default).
661-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
662-
DataFrame.
662+
* ``"pyarrow"``: returns pyarrow-backed nullable
663+
:class:`ArrowDtype` :class:`DataFrame`
663664
664665
.. versionadded:: 2.0
665666

pandas/io/orc.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ def read_orc(
6161
Output always follows the ordering of the file and not the columns list.
6262
This mirrors the original behaviour of
6363
:external+pyarrow:py:meth:`pyarrow.orc.ORCFile.read`.
64-
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
64+
dtype_backend : {'numpy_nullable', 'pyarrow'}
6565
Back-end data type applied to the resultant :class:`DataFrame`
66-
(still experimental). Behaviour is as follows:
66+
(still experimental). If not specified, the default behavior
67+
is to not use nullable data types. If specified, the behavior
68+
is as follows:
6769
6870
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
69-
(default).
70-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
71-
DataFrame.
71+
* ``"pyarrow"``: returns pyarrow-backed nullable
72+
:class:`ArrowDtype` :class:`DataFrame`
7273
7374
.. versionadded:: 2.0
7475

pandas/io/parquet.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -542,14 +542,15 @@ def read_parquet(
542542
543543
.. versionadded:: 1.3.0
544544
545-
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
545+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
546546
Back-end data type applied to the resultant :class:`DataFrame`
547-
(still experimental). Behaviour is as follows:
547+
(still experimental). If not specified, the default behavior
548+
is to not use nullable data types. If specified, the behavior
549+
is as follows:
548550
549551
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
550-
(default).
551-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
552-
DataFrame.
552+
* ``"pyarrow"``: returns pyarrow-backed nullable
553+
:class:`ArrowDtype` :class:`DataFrame`
553554
554555
.. versionadded:: 2.0
555556

pandas/io/parsers/readers.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -438,14 +438,14 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
438438
439439
{storage_options}
440440
441-
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
441+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
442442
Back-end data type applied to the resultant :class:`DataFrame`
443-
(still experimental). Behaviour is as follows:
443+
(still experimental). If not specified, the default behavior
444+
is to not use nullable data types. If specified, the behavior
445+
is as follows:
444446
445447
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
446-
(default).
447-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
448-
DataFrame.
448+
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` :class:`DataFrame`
449449
450450
.. versionadded:: 2.0
451451

pandas/io/spss.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@ 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'}, default 'numpy_nullable'
39+
dtype_backend : {'numpy_nullable', 'pyarrow'}
4040
Back-end data type applied to the resultant :class:`DataFrame`
41-
(still experimental). Behaviour is as follows:
41+
(still experimental). If not specified, the default behavior
42+
is to not use nullable data types. If specified, the behavior
43+
is as follows:
4244
4345
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
44-
(default).
45-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
46-
DataFrame.
46+
* ``"pyarrow"``: returns pyarrow-backed
47+
nullable :class:`ArrowDtype` :class:`DataFrame`
4748
4849
.. versionadded:: 2.0
4950

pandas/io/sql.py

+30-25
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,15 @@ def read_sql_table(
306306
chunksize : int, default None
307307
If specified, returns an iterator where `chunksize` is the number of
308308
rows to include in each chunk.
309-
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
309+
dtype_backend : {'numpy_nullable', 'pyarrow'}
310310
Back-end data type applied to the resultant :class:`DataFrame`
311-
(still experimental). Behaviour is as follows:
311+
(still experimental). If not specified, the default behavior
312+
is to not use nullable data types. If specified, the behavior
313+
is as follows:
312314
313315
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
314-
(default).
315-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
316-
DataFrame.
316+
* ``"pyarrow"``: returns pyarrow-backed nullable
317+
:class:`ArrowDtype` :class:`DataFrame`
317318
318319
.. versionadded:: 2.0
319320
@@ -443,14 +444,15 @@ 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'}, default 'numpy_nullable'
447+
dtype_backend : {'numpy_nullable', 'pyarrow'}
447448
Back-end data type applied to the resultant :class:`DataFrame`
448-
(still experimental). Behaviour is as follows:
449+
(still experimental). If not specified, the default behavior
450+
is to not use nullable data types. If specified, the behavior
451+
is as follows:
449452
450453
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
451-
(default).
452-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
453-
DataFrame.
454+
* ``"pyarrow"``: returns pyarrow-backed nullable
455+
:class:`ArrowDtype` :class:`DataFrame`
454456
455457
.. versionadded:: 2.0
456458
@@ -586,14 +588,15 @@ def read_sql(
586588
chunksize : int, default None
587589
If specified, return an iterator where `chunksize` is the
588590
number of rows to include in each chunk.
589-
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
591+
dtype_backend : {'numpy_nullable', 'pyarrow'}
590592
Back-end data type applied to the resultant :class:`DataFrame`
591-
(still experimental). Behaviour is as follows:
593+
(still experimental). If not specified, the default behavior
594+
is to not use nullable data types. If specified, the behavior
595+
is as follows:
592596
593597
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
594-
(default).
595-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
596-
DataFrame.
598+
* ``"pyarrow"``: returns pyarrow-backed nullable
599+
:class:`ArrowDtype` :class:`DataFrame`
597600
598601
.. versionadded:: 2.0
599602
dtype : Type name or dict of columns
@@ -1683,14 +1686,15 @@ def read_table(
16831686
chunksize : int, default None
16841687
If specified, return an iterator where `chunksize` is the number
16851688
of rows to include in each chunk.
1686-
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
1689+
dtype_backend : {'numpy_nullable', 'pyarrow'}
16871690
Back-end data type applied to the resultant :class:`DataFrame`
1688-
(still experimental). Behaviour is as follows:
1691+
(still experimental). If not specified, the default behavior
1692+
is to not use nullable data types. If specified, the behavior
1693+
is as follows:
16891694
16901695
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
1691-
(default).
1692-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
1693-
DataFrame.
1696+
* ``"pyarrow"``: returns pyarrow-backed nullable
1697+
:class:`ArrowDtype` :class:`DataFrame`
16941698
16951699
.. versionadded:: 2.0
16961700
@@ -2148,14 +2152,15 @@ def read_table(
21482152
schema of the SQL database object.
21492153
chunksize : int, default None
21502154
Raises NotImplementedError
2151-
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
2155+
dtype_backend : {'numpy_nullable', 'pyarrow'}
21522156
Back-end data type applied to the resultant :class:`DataFrame`
2153-
(still experimental). Behaviour is as follows:
2157+
(still experimental). If not specified, the default behavior
2158+
is to not use nullable data types. If specified, the behavior
2159+
is as follows:
21542160
21552161
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
2156-
(default).
2157-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
2158-
DataFrame.
2162+
* ``"pyarrow"``: returns pyarrow-backed nullable
2163+
:class:`ArrowDtype` :class:`DataFrame`
21592164
21602165
.. versionadded:: 2.0
21612166

pandas/io/xml.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -959,14 +959,15 @@ def read_xml(
959959
960960
{storage_options}
961961
962-
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
962+
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
963963
Back-end data type applied to the resultant :class:`DataFrame`
964-
(still experimental). Behaviour is as follows:
964+
(still experimental). If not specified, the default behavior
965+
is to not use nullable data types. If specified, the behavior
966+
is as follows:
965967
966968
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
967-
(default).
968-
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
969-
DataFrame.
969+
* ``"pyarrow"``: returns pyarrow-backed nullable
970+
:class:`ArrowDtype` :class:`DataFrame`
970971
971972
.. versionadded:: 2.0
972973

0 commit comments

Comments
 (0)