From 2f4e404061efec96bb9e5598976abf454fb10595 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Tue, 22 Jul 2025 09:26:08 +0200 Subject: [PATCH 1/2] DOC: explicitly mention new str dtype is no longer a numpy dtype in migration guide --- doc/source/user_guide/migration-3-strings.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/source/user_guide/migration-3-strings.rst b/doc/source/user_guide/migration-3-strings.rst index c415f8f43d3c8..c9c6c616c6fba 100644 --- a/doc/source/user_guide/migration-3-strings.rst +++ b/doc/source/user_guide/migration-3-strings.rst @@ -118,12 +118,17 @@ through the ``str`` accessor will work the same: Overview of behavior differences and how to address them --------------------------------------------------------- -The dtype is no longer object dtype -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The dtype is no longer a numpy object dtype +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When inferring or reading string data, the data type of the resulting DataFrame column or Series will silently start being the new ``"str"`` dtype instead of -``"object"`` dtype, and this can have some impact on your code. +the numpy ``"object"`` dtype, and this can have some impact on your code. + +The new string dtype is a pandas data type ("extension dtype"), and no longer a +numpy ``np.dtype`` instance. Therefore, passing the dtype of a string column to +numpy functions will no longer work (e.g. passing it to a ``dtype=`` argument +of a numpy function, or using ``np.issubdtype`` to check the dtype). Checking the dtype ^^^^^^^^^^^^^^^^^^ From 9c427ee239f236e141e411ba5087ebd877282bc8 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Sat, 26 Jul 2025 10:28:53 +0200 Subject: [PATCH 2/2] update title --- doc/source/user_guide/migration-3-strings.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/user_guide/migration-3-strings.rst b/doc/source/user_guide/migration-3-strings.rst index c9c6c616c6fba..c103b88c1db5d 100644 --- a/doc/source/user_guide/migration-3-strings.rst +++ b/doc/source/user_guide/migration-3-strings.rst @@ -118,8 +118,8 @@ through the ``str`` accessor will work the same: Overview of behavior differences and how to address them --------------------------------------------------------- -The dtype is no longer a numpy object dtype -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The dtype is no longer a numpy "object" dtype +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When inferring or reading string data, the data type of the resulting DataFrame column or Series will silently start being the new ``"str"`` dtype instead of