diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index a2bebc7dd3217..ea150f714845c 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -91,6 +91,16 @@ def to_numeric( set to True, nullable dtypes are used for all dtypes that have a nullable implementation, even if no nulls are present. + .. note:: + + The nullable dtype implementation can be configured by calling + ``pd.set_option("mode.dtype_backend", "pandas")`` to use + numpy-backed nullable dtypes or + ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use + pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + + .. versionadded:: 2.0.0 + Returns ------- ret diff --git a/pandas/io/clipboards.py b/pandas/io/clipboards.py index 0ba3846f415ad..2872263e712d7 100644 --- a/pandas/io/clipboards.py +++ b/pandas/io/clipboards.py @@ -36,13 +36,15 @@ def read_clipboard( set to True, nullable dtypes are used for all dtypes that have a nullable implementation, even if no nulls are present. - The nullable dtype implementation can be configured by calling - ``pd.set_option("mode.dtype_backend", "pandas")`` to use - numpy-backed nullable dtypes or - ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use - pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). - This is only implemented for the ``python`` - engine. + .. note:: + + The nullable dtype implementation can be configured by calling + ``pd.set_option("mode.dtype_backend", "pandas")`` to use + numpy-backed nullable dtypes or + ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use + pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + This is only implemented for the ``python`` + engine. .. versionadded:: 2.0 diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 6fb6d72bab099..2a0d3a01d3383 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -278,6 +278,14 @@ set to True, nullable dtypes are used for all dtypes that have a nullable implementation, even if no nulls are present. Dtype takes precedence if given. + .. note:: + + The nullable dtype implementation can be configured by calling + ``pd.set_option("mode.dtype_backend", "pandas")`` to use + numpy-backed nullable dtypes or + ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use + pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + .. versionadded:: 2.0 Returns diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index 136f49fef156e..28448400d8aa7 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -131,11 +131,13 @@ def read_feather( set to True, nullable dtypes are used for all dtypes that have a nullable implementation, even if no nulls are present. - The nullable dtype implementation can be configured by calling - ``pd.set_option("mode.dtype_backend", "pandas")`` to use - numpy-backed nullable dtypes or - ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use - pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + .. note:: + + The nullable dtype implementation can be configured by calling + ``pd.set_option("mode.dtype_backend", "pandas")`` to use + numpy-backed nullable dtypes or + ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use + pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). .. versionadded:: 2.0 diff --git a/pandas/io/html.py b/pandas/io/html.py index dd1f7ef239f73..af723cdebd850 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -1145,11 +1145,13 @@ def read_html( set to True, nullable dtypes are used for all dtypes that have a nullable implementation, even if no nulls are present. - The nullable dtype implementation can be configured by calling - ``pd.set_option("mode.dtype_backend", "pandas")`` to use - numpy-backed nullable dtypes or - ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use - pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + .. note:: + + The nullable dtype implementation can be configured by calling + ``pd.set_option("mode.dtype_backend", "pandas")`` to use + numpy-backed nullable dtypes or + ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use + pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). .. versionadded:: 2.0 diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index fb64e089d53a8..66991eab54671 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -643,11 +643,13 @@ def read_json( set to True, nullable dtypes are used for all dtypes that have a nullable implementation, even if no nulls are present. - The nullable dtype implementation can be configured by calling - ``pd.set_option("mode.dtype_backend", "pandas")`` to use - numpy-backed nullable dtypes or - ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use - pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + .. note:: + + The nullable dtype implementation can be configured by calling + ``pd.set_option("mode.dtype_backend", "pandas")`` to use + numpy-backed nullable dtypes or + ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use + pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). .. versionadded:: 2.0 diff --git a/pandas/io/orc.py b/pandas/io/orc.py index ccc7afe7ee0f7..27a4b2e0cbac4 100644 --- a/pandas/io/orc.py +++ b/pandas/io/orc.py @@ -59,20 +59,19 @@ def read_orc( This mirrors the original behaviour of :external+pyarrow:py:meth:`pyarrow.orc.ORCFile.read`. use_nullable_dtypes : bool, default False - If True, use dtypes that use ``pd.NA`` as missing value indicator - for the resulting DataFrame. + Whether or not to use nullable dtypes as default when reading data. If + set to True, nullable dtypes are used for all dtypes that have a nullable + implementation, even if no nulls are present. - The nullable dtype implementation can be configured by calling - ``pd.set_option("mode.dtype_backend", "pandas")`` to use - numpy-backed nullable dtypes or - ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use - pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + .. note:: - .. versionadded:: 2.0.0 + The nullable dtype implementation can be configured by calling + ``pd.set_option("mode.dtype_backend", "pandas")`` to use + numpy-backed nullable dtypes or + ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use + pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). - .. note - - Currently only ``mode.dtype_backend`` set to ``"pyarrow"`` is supported. + .. versionadded:: 2.0 **kwargs Any additional kwargs are passed to pyarrow. diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 2a33ec8969838..49e0eea8259db 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -497,13 +497,15 @@ def read_parquet( .. versionadded:: 1.2.0 - The nullable dtype implementation can be configured by calling - ``pd.set_option("mode.dtype_backend", "pandas")`` to use - numpy-backed nullable dtypes or - ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use - pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + .. note:: - .. versionadded:: 2.0.0 + The nullable dtype implementation can be configured by calling + ``pd.set_option("mode.dtype_backend", "pandas")`` to use + numpy-backed nullable dtypes or + ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use + pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + + .. versionadded:: 2.0.0 **kwargs Any additional kwargs are passed to the engine. diff --git a/pandas/io/parsers/readers.py b/pandas/io/parsers/readers.py index 410b4fc0bf9c0..89d5c7742588a 100644 --- a/pandas/io/parsers/readers.py +++ b/pandas/io/parsers/readers.py @@ -401,13 +401,15 @@ set to True, nullable dtypes are used for all dtypes that have a nullable implementation, even if no nulls are present. - The nullable dtype implementation can be configured by calling - ``pd.set_option("mode.dtype_backend", "pandas")`` to use - numpy-backed nullable dtypes or - ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use - pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). - This is only implemented for the ``pyarrow`` or ``python`` - engines. + .. note:: + + The nullable dtype implementation can be configured by calling + ``pd.set_option("mode.dtype_backend", "pandas")`` to use + numpy-backed nullable dtypes or + ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use + pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + This is only implemented for the ``pyarrow`` or ``python`` + engines. .. versionadded:: 2.0 @@ -1271,6 +1273,16 @@ def read_fwf( set to True, nullable dtypes are used for all dtypes that have a nullable implementation, even if no nulls are present. + .. note:: + + The nullable dtype implementation can be configured by calling + ``pd.set_option("mode.dtype_backend", "pandas")`` to use + numpy-backed nullable dtypes or + ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use + pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + This is only implemented for the ``pyarrow`` or ``python`` + engines. + .. versionadded:: 2.0 **kwds : optional diff --git a/pandas/io/xml.py b/pandas/io/xml.py index 4e6afbf4f4164..64fda2fdb0299 100644 --- a/pandas/io/xml.py +++ b/pandas/io/xml.py @@ -988,11 +988,13 @@ def read_xml( set to True, nullable dtypes are used for all dtypes that have a nullable implementation, even if no nulls are present. - The nullable dtype implementation can be configured by calling - ``pd.set_option("mode.dtype_backend", "pandas")`` to use - numpy-backed nullable dtypes or - ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use - pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). + .. note:: + + The nullable dtype implementation can be configured by calling + ``pd.set_option("mode.dtype_backend", "pandas")`` to use + numpy-backed nullable dtypes or + ``pd.set_option("mode.dtype_backend", "pyarrow")`` to use + pyarrow-backed nullable dtypes (using ``pd.ArrowDtype``). .. versionadded:: 2.0