Skip to content

Commit

Permalink
DOC: More doc fix for dtype_backend (pandas-dev#59071)
Browse files Browse the repository at this point in the history
  • Loading branch information
luke396 authored and shreyas-dev committed Aug 13, 2024
1 parent 9a92fb4 commit 998708e
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 89 deletions.
4 changes: 1 addition & 3 deletions pandas/core/dtypes/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,10 +1014,8 @@ def convert_dtypes(
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"numpy_nullable"``: returns nullable-dtype
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
.. versionadded:: 2.0
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6670,10 +6670,10 @@ def convert_dtypes(
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`
or :class:`Series` (default).
* ``"numpy_nullable"``: returns nullable-dtype-backed
:class:`DataFrame` or :class:`Serires`.
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame or Series.
:class:`DataFrame` or :class:`Series`.
.. versionadded:: 2.0
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/tools/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def to_numeric(
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns with nullable-dtype-backed
* ``"pyarrow"``: returns with pyarrow-backed nullable :class:`ArrowDtype`
* ``"numpy_nullable"``: returns nullable-dtype-backed object
* ``"pyarrow"``: returns with pyarrow-backed nullable object
.. versionadded:: 2.0
Expand Down
11 changes: 6 additions & 5 deletions pandas/io/clipboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ def read_clipboard(
A string or regex delimiter. The default of ``'\\s+'`` denotes
one or more whitespace characters.
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
dtype_backend : {'numpy_nullable', 'pyarrow'}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down
22 changes: 12 additions & 10 deletions pandas/io/excel/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,15 @@
Rows at the end to skip (0-indexed).
{storage_options}
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down Expand Up @@ -1728,14 +1729,15 @@ def parse(
comment string and the end of the current line is ignored.
skipfooter : int, default 0
Rows at the end to skip (0-indexed).
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
**kwds : dict, optional
Expand Down
13 changes: 7 additions & 6 deletions pandas/io/feather_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,15 @@ def read_feather(
Whether to parallelize reading using multiple threads.
{storage_options}
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down
11 changes: 6 additions & 5 deletions pandas/io/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,14 +1131,15 @@ def read_html(
.. versionadded:: 1.5.0
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down
11 changes: 6 additions & 5 deletions pandas/io/json/_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,14 +652,15 @@ def read_json(
{storage_options}
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down
11 changes: 6 additions & 5 deletions pandas/io/orc.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ def read_orc(
Output always follows the ordering of the file and not the columns list.
This mirrors the original behaviour of
:external+pyarrow:py:meth:`pyarrow.orc.ORCFile.read`.
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
dtype_backend : {'numpy_nullable', 'pyarrow'}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down
11 changes: 6 additions & 5 deletions pandas/io/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,14 +542,15 @@ def read_parquet(
.. versionadded:: 1.3.0
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down
10 changes: 5 additions & 5 deletions pandas/io/parsers/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,14 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
{storage_options}
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down
11 changes: 6 additions & 5 deletions pandas/io/spss.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ def read_spss(
Return a subset of the columns. If None, return all columns.
convert_categoricals : bool, default is True
Convert categorical columns into pd.Categorical.
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
dtype_backend : {'numpy_nullable', 'pyarrow'}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed
nullable :class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down
55 changes: 30 additions & 25 deletions pandas/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,15 @@ def read_sql_table(
chunksize : int, default None
If specified, returns an iterator where `chunksize` is the number of
rows to include in each chunk.
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
dtype_backend : {'numpy_nullable', 'pyarrow'}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down Expand Up @@ -443,14 +444,15 @@ def read_sql_query(
{'a': np.float64, 'b': np.int32, 'c': 'Int64'}.
.. versionadded:: 1.3.0
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
dtype_backend : {'numpy_nullable', 'pyarrow'}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down Expand Up @@ -586,14 +588,15 @@ def read_sql(
chunksize : int, default None
If specified, return an iterator where `chunksize` is the
number of rows to include in each chunk.
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
dtype_backend : {'numpy_nullable', 'pyarrow'}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
dtype : Type name or dict of columns
Expand Down Expand Up @@ -1683,14 +1686,15 @@ def read_table(
chunksize : int, default None
If specified, return an iterator where `chunksize` is the number
of rows to include in each chunk.
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
dtype_backend : {'numpy_nullable', 'pyarrow'}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down Expand Up @@ -2148,14 +2152,15 @@ def read_table(
schema of the SQL database object.
chunksize : int, default None
Raises NotImplementedError
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable'
dtype_backend : {'numpy_nullable', 'pyarrow'}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down
11 changes: 6 additions & 5 deletions pandas/io/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,14 +959,15 @@ def read_xml(
{storage_options}
dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
Back-end data type applied to the resultant :class:`DataFrame`
(still experimental). Behaviour is as follows:
(still experimental). If not specified, the default behavior
is to not use nullable data types. If specified, the behavior
is as follows:
* ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
(default).
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"pyarrow"``: returns pyarrow-backed nullable
:class:`ArrowDtype` :class:`DataFrame`
.. versionadded:: 2.0
Expand Down

0 comments on commit 998708e

Please sign in to comment.