Skip to content

Commit 8f9d14a

Browse files
committed
Suggested edits
1 parent 237125b commit 8f9d14a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

doc/source/user_guide/basics.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,6 +2378,10 @@ To select string columns include ``str``:
23782378
23792379
df.select_dtypes(include=[str])
23802380
2381+
.. note::
2382+
2383+
This is a change in pandas 3.0. Previously strings were stored in ``object`` dtype columns, so would be selected with ``include=[object]``. See https://pandas.pydata.org/docs/user_guide/migration-3-strings.html#hardcoded-use-of-object-dtype.
2384+
23812385
To see all the child dtypes of a generic ``dtype`` like ``numpy.number`` you
23822386
can define a function that returns a tree of child dtypes:
23832387

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5250,7 +5250,7 @@ def predicate(arr: ArrayLike) -> bool:
52505250
# GH#61916
52515251
warnings.warn(
52525252
"For backward compatibility, 'str' dtypes are included by "
5253-
"select_dtypes when object dtypes are specified. "
5253+
"select_dtypes when 'object' dtype is specified. "
52545254
"This behavior is deprecated and will be removed in a future "
52555255
"version. Explicitly pass 'str' to `include` to select them, "
52565256
"or to `exclude` to remove them and silence this warning.",

0 commit comments

Comments
 (0)