23
23
<div class =" card-body" >
24
24
<p class =" card-text" >
25
25
26
- This tutorial uses the titanic data set, stored as CSV. The data
26
+ This tutorial uses the Titanic data set, stored as CSV. The data
27
27
consists of the following data columns:
28
28
29
29
- PassengerId: Id of every passenger.
@@ -102,7 +102,7 @@ Create a new column ``Surname`` that contains the surname of the Passengers by e
102
102
103
103
Using the :meth: `Series.str.split ` method, each of the values is returned as a list of
104
104
2 elements. The first element is the part before the comma and the
105
- second element the part after the comma.
105
+ second element is the part after the comma.
106
106
107
107
.. ipython :: python
108
108
@@ -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 Countess 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,24 +145,24 @@ Extract the passenger data about the Countess 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
152
for each of the values ``True `` (``Countess `` is part of the name) of
153
- ``False `` (``Countess `` is notpart of the name). This output can be used
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 1 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
160
160
</li >
161
161
</ul >
162
162
163
163
.. note ::
164
- More powerful extractions on strings is supported, as the
165
- :meth: `Series.str.contains ` and :meth: `Series.str.extract ` methods accepts `regular
164
+ More powerful extractions on strings are supported, as the
165
+ :meth: `Series.str.contains ` and :meth: `Series.str.extract ` methods accept `regular
166
166
expressions <https://docs.python.org/3/library/re.html> `__, but out of
167
167
scope of this tutorial.
168
168
@@ -182,7 +182,7 @@ More information on extracting parts of strings is available in the user guide s
182
182
<ul class =" task-bullet" >
183
183
<li >
184
184
185
- Which passenger of the titanic has the longest name?
185
+ Which passenger of the Titanic has the longest name?
186
186
187
187
.. ipython :: python
188
188
@@ -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’ columns , replace values of ‘ male’ by ‘M’ and all ‘ female’ values 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
0 commit comments