@@ -986,7 +986,7 @@ not noted for a particular column will be ``NaN``:
986986
987987 tsdf.agg({' A' : [' mean' , ' min' ], ' B' : ' sum' })
988988
989- .. _basics.aggregation.mixed_dtypes :
989+ .. _basics.aggregation.mixed_string :
990990
991991Mixed dtypes
992992++++++++++++
@@ -1704,14 +1704,21 @@ built-in string methods. For example:
17041704
17051705 .. ipython :: python
17061706
1707- s = pd.Series([' A' , ' B' , ' C' , ' Aaba' , ' Baca' , np.nan, ' CABA' , ' dog' , ' cat' ])
1707+ s = pd.Series([' A' , ' B' , ' C' , ' Aaba' , ' Baca' , np.nan, ' CABA' , ' dog' , ' cat' ],
1708+ dtype = " string" )
17081709 s.str.lower()
17091710
17101711 Powerful pattern-matching methods are provided as well, but note that
17111712pattern-matching generally uses `regular expressions
17121713<https://docs.python.org/3/library/re.html> `__ by default (and in some cases
17131714always uses them).
17141715
1716+ .. note ::
1717+
1718+ Prior to pandas 1.0, string methods were only available on ``object `` -dtype
1719+ ``Series ``. Pandas 1.0 added the :class: `StringDtype ` which is dedicated
1720+ to strings. See :ref: `text.types ` for more.
1721+
17151722Please see :ref: `Vectorized String Methods <text.string_methods >` for a complete
17161723description.
17171724
@@ -1925,9 +1932,15 @@ period (time spans) :class:`PeriodDtype` :class:`Period` :class:`arrays.
19251932sparse :class: `SparseDtype ` (none) :class: `arrays.SparseArray ` :ref: `sparse `
19261933intervals :class: `IntervalDtype ` :class: `Interval ` :class: `arrays.IntervalArray ` :ref: `advanced.intervalindex `
19271934nullable integer :class: `Int64Dtype `, ... (none) :class: `arrays.IntegerArray ` :ref: `integer_na `
1935+ Strings :class: `StringDtype ` :class: `str ` :class: `arrays.StringArray ` :ref: `text `
19281936=================== ========================= ================== ============================= =============================
19291937
1930- Pandas uses the ``object `` dtype for storing strings.
1938+ Pandas has two ways to store strings.
1939+
1940+ 1. ``object `` dtype, which can hold any Python object, including strings.
1941+ 2. :class: `StringDtype `, which is dedicated to strings.
1942+
1943+ Generally, we recommend using :class: `StringDtype `. See :ref: `text.types ` fore more.
19311944
19321945Finally, arbitrary objects may be stored using the ``object `` dtype, but should
19331946be avoided to the extent possible (for performance and interoperability with
0 commit comments