Skip to content

DOC: [ArrowStringArray] release note and other documentation #40747

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
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
50 changes: 50 additions & 0 deletions doc/source/whatsnew/v1.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,56 @@ a copy will no longer be made (:issue:`32960`)
The default behavior when not passing ``copy`` will remain unchanged, i.e.
a copy will be made.

.. _whatsnew_130.arrow_string:

PyArrow backed string data type
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

We've enhanced the :class:`StringDtype`, an extension type dedicated to string data.
(:issue:`39908`)

It is now possible to specify a ``storage`` keyword option to :class:`StringDtype`, use
pandas options or specify the dtype using ``dtype='string[pyarrow]'``

.. warning::

``string[pyarrow]`` is currently considered experimental. The implementation
and parts of the API may change without warning.

The ``'string[pyarrow]'`` extension type solves several issues with NumPy backed arrays:

1.
2.
3.


.. ipython:: python

pd.Series(['abc', None, 'def'], dtype=pd.StringDtype(storage="pyarrow"))

You can use the alias ``"string[pyarrow]"`` as well.

.. ipython:: python

s = pd.Series(['abc', None, 'def'], dtype="string[pyarrow]")
s

The usual string accessor methods work. Where appropriate, the return type
of the Series or columns of a DataFrame will also have string dtype.

.. ipython:: python

s.str.upper()
s.str.split('b', expand=True).dtypes

String accessor methods returning integers will return a value with :class:`Int64Dtype`

.. ipython:: python

s.str.count("a")

See :ref:`text.types` for more.

.. _whatsnew_130.enhancements.other:

Other enhancements
Expand Down