Skip to content

BUG/DOC: Update dtype_backend documentation and API #55692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pandas/io/parsers/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,15 @@

.. versionadded:: 1.2

dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
dtype_backend : {{'numpy_nullable', 'pyarrow', 'numpy'}}, default 'numpy'
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-backed :class:`DataFrame`.
* ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
DataFrame.
* ``"numpy"``: returns numpy-backed :class:`DataFrame`
(default).

.. versionadded:: 2.0

Expand Down Expand Up @@ -2127,6 +2128,9 @@ def _refine_defaults_read(
else:
raise ValueError(f"Argument {on_bad_lines} is invalid for on_bad_lines")

if dtype_backend == "numpy":
dtype_backend = lib.no_default

check_dtype_backend(dtype_backend)

kwds["dtype_backend"] = dtype_backend
Expand Down