Skip to content

Commit 0287fbd

Browse files
DOC: clarify migration guide for users of existing string dtypes
1 parent 04a554c commit 0287fbd

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

doc/source/user_guide/migration-3-strings.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,20 @@ raise an error regardless of the number of strings:
457457
...
458458
TypeError: Cannot perform reduction 'prod' with string dtype
459459
460-
.. For existing users of the nullable ``StringDtype``
461-
.. --------------------------------------------------
460+
For existing users of the nullable ``StringDtype``
461+
--------------------------------------------------
462+
463+
While pandas 3.0 introduces a new _default_ string data type, pandas had an
464+
opt-in nullable string data type since pandas 1.0, which can be specified using
465+
``dtype="string"``. This nullable string dtype uses ``pd.NA`` as the missing
466+
value indicator. In addition, also through :class:`ArrowDtype` (by using
467+
``dtypes_backend="pyarrow"``) since pandas 1.5, one could already make use of
468+
a dedicated string dtype.
469+
470+
If you are already using one of the nullable string dtypes, for example by
471+
specifying ``dtype="string"``, by using :meth:`~DataFrame.convert_dtypes`, or
472+
by specifying the ``dtype_backend`` argument in IO functions, you can continue
473+
to do so without change.
462474

463-
.. TODO
475+
The migration guide above applies to code that is currently (< 3.0) using object
476+
dtype for string data.

0 commit comments

Comments
 (0)