@@ -13,7 +13,7 @@ Text data types
13
13
14
14
There are two ways to store text data in pandas:
15
15
16
- 1. ``object `` - dtype NumPy array.
16
+ 1. ``object `` dtype NumPy array.
17
17
2. :class: `StringDtype ` extension type.
18
18
19
19
We recommend using :class: `StringDtype ` to store text data.
@@ -40,20 +40,20 @@ to significantly increase the performance and lower the memory overhead of
40
40
and parts of the API may change without warning.
41
41
42
42
For backwards-compatibility, ``object `` dtype remains the default type we
43
- infer a list of strings to
43
+ infer a list of strings to:
44
44
45
45
.. ipython :: python
46
46
47
47
pd.Series([" a" , " b" , " c" ])
48
48
49
- To explicitly request ``string `` dtype, specify the ``dtype ``
49
+ To explicitly request ``string `` dtype, specify the ``dtype ``:
50
50
51
51
.. ipython :: python
52
52
53
53
pd.Series([" a" , " b" , " c" ], dtype = " string" )
54
54
pd.Series([" a" , " b" , " c" ], dtype = pd.StringDtype())
55
55
56
- Or ``astype `` after the ``Series `` or ``DataFrame `` is created
56
+ Or ``astype `` after the ``Series `` or ``DataFrame `` is created:
57
57
58
58
.. ipython :: python
59
59
@@ -88,7 +88,7 @@ Behavior differences
88
88
^^^^^^^^^^^^^^^^^^^^
89
89
90
90
These are places where the behavior of ``StringDtype `` objects differ from
91
- ``object `` dtype
91
+ ``object `` dtype:
92
92
93
93
l. For ``StringDtype ``, :ref: `string accessor methods<api.series.str> `
94
94
that return **numeric ** output will always return a nullable integer dtype,
@@ -102,7 +102,7 @@ l. For ``StringDtype``, :ref:`string accessor methods<api.series.str>`
102
102
s.str.count(" a" )
103
103
s.dropna().str.count(" a" )
104
104
105
- Both outputs are ``Int64 `` dtype. Compare that with object-dtype
105
+ Both outputs are ``Int64 `` dtype. Compare that with object-dtype:
106
106
107
107
.. ipython :: python
108
108
0 commit comments