@@ -66,15 +66,15 @@ How to manipulate textual data?
66
66
<ul class =" task-bullet" >
67
67
<li >
68
68
69
- Make all name characters lowercase
69
+ Make all name characters lowercase.
70
70
71
71
.. ipython :: python
72
72
73
73
titanic[" Name" ].str.lower()
74
74
75
75
To make each of the strings in the ``Name `` column lowercase, select the ``Name `` column
76
- (see :ref: `tutorial on selection of data <10min_tut_03_subset >`), add the ``str `` accessor and
77
- apply the ``lower `` method. As such, each of the strings is converted element wise.
76
+ (see the :ref: `tutorial on selection of data <10min_tut_03_subset >`), add the ``str `` accessor and
77
+ apply the ``lower `` method. As such, each of the strings is converted element- wise.
78
78
79
79
.. raw :: html
80
80
@@ -86,15 +86,15 @@ having a ``dt`` accessor, a number of
86
86
specialized string methods are available when using the ``str ``
87
87
accessor. These methods have in general matching names with the
88
88
equivalent built-in string methods for single elements, but are applied
89
- element-wise (remember :ref: `element wise calculations <10min_tut_05_columns >`?)
89
+ element-wise (remember :ref: `element- wise calculations <10min_tut_05_columns >`?)
90
90
on each of the values of the columns.
91
91
92
92
.. raw :: html
93
93
94
94
<ul class =" task-bullet" >
95
95
<li >
96
96
97
- Create a new column ``Surname `` that contains the surname of the Passengers by extracting the part before the comma.
97
+ Create a new column ``Surname `` that contains the surname of the passengers by extracting the part before the comma.
98
98
99
99
.. ipython :: python
100
100
@@ -135,7 +135,7 @@ More information on extracting parts of strings is available in the user guide s
135
135
<ul class =" task-bullet" >
136
136
<li >
137
137
138
- Extract the passenger data about the Countesses on board of the Titanic.
138
+ Extract the passenger data about the countesses on board of the Titanic.
139
139
140
140
.. ipython :: python
141
141
@@ -145,15 +145,15 @@ Extract the passenger data about the Countesses on board of the Titanic.
145
145
146
146
titanic[titanic[" Name" ].str.contains(" Countess" )]
147
147
148
- (*Interested in her story? See * \ `Wikipedia <https://en.wikipedia.org/wiki/No%C3%ABl_Leslie,_Countess_of_Rothes>`__\ *! *)
148
+ (*Interested in her story? See * `Wikipedia <https://en.wikipedia.org/wiki/No%C3%ABl_Leslie,_Countess_of_Rothes >`__\ *! *)
149
149
150
150
The string method :meth: `Series.str.contains ` checks for each of the values in the
151
151
column ``Name `` if the string contains the word ``Countess `` and returns
152
- for each of the values ``True `` (``Countess `` is part of the name) of
152
+ for each of the values ``True `` (``Countess `` is part of the name) or
153
153
``False `` (``Countess `` is not part of the name). This output can be used
154
154
to subselect the data using conditional (boolean) indexing introduced in
155
155
the :ref: `subsetting of data tutorial <10min_tut_03_subset >`. As there was
156
- only one Countess on the Titanic, we get one row as a result.
156
+ only one countess on the Titanic, we get one row as a result.
157
157
158
158
.. raw :: html
159
159
@@ -220,7 +220,7 @@ we can do a selection using the ``loc`` operator, introduced in the
220
220
<ul class =" task-bullet" >
221
221
<li >
222
222
223
- In the "Sex" column, replace values of "male" by "M" and values of "female" by "F"
223
+ In the "Sex" column, replace values of "male" by "M" and values of "female" by "F".
224
224
225
225
.. ipython :: python
226
226
@@ -256,7 +256,7 @@ a ``dictionary`` to define the mapping ``{from : to}``.
256
256
<h4 >REMEMBER</h4 >
257
257
258
258
- String methods are available using the ``str `` accessor.
259
- - String methods work element wise and can be used for conditional
259
+ - String methods work element- wise and can be used for conditional
260
260
indexing.
261
261
- The ``replace `` method is a convenient method to convert values
262
262
according to a given dictionary.
0 commit comments