8000 whatsnew 1.3.0 by rhshadrach · Pull Request #41747 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

whatsnew 1.3.0 #41747

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

Merged
merged 13 commits into from
Jun 9, 2021
Merged
Prev Previous commit
Next Next commit
Merge branch 'master' of https://github.com/pandas-dev/pandas into wh…
…atsnew1.3

� Conflicts:
�	doc/source/whatsnew/v1.3.0.rst
  • Loading branch information
rhshadrach committed Jun 9, 2021
commit 78011188652b491009f071a5c2d112e1562e8cc4
52 changes: 52 additions & 0 deletions doc/source/whatsnew/v1.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,58 @@ 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]'`` to allow the
StringArray to be backed by a PyArrow array instead of a NumPy array of Python objects.

The PyArrow backed StringArray requires pyarrow 1.0.0 or greater to be installed.

.. warning::

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

.. 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

You can also create a PyArrow backed string array using pandas options.

.. ipython:: python

with pd.option_context("string_storage", "pyarrow"):
s = pd.Series(['abc', None, 'def'], dtype="string")
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")

.. _whatsnew_130.centered_datetimelike_rolling_window:

Centered datetime-like rolling windows
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0