Skip to content

Commit e8b85d4

Browse files
committed
slight style fixes
1 parent 9c7ba90 commit e8b85d4

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

chapter2.md

+11-13
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,18 @@ test = pd.read_csv("http://s3.amazonaws.com/assets.datacamp.com/course/Kaggle/te
3838

3939
*** =sample_code
4040
```{python}
41-
#Import the Numpy library
41+
# Import the Numpy library
4242
43-
#Import 'tree' from scikit-learn library
43+
# Import 'tree' from scikit-learn library
4444
from sklearn
45-
4645
```
4746

4847
*** =solution
4948
```{python}
50-
#Import the Numpy library
49+
# Import the Numpy library
5150
import numpy as np
5251
53-
#Import 'tree' from scikit-learn library
52+
# Import 'tree' from scikit-learn library
5453
from sklearn import tree
5554
```
5655

@@ -91,18 +90,17 @@ import numpy as np
9190
from sklearn import tree
9291
train = pd.read_csv("http://s3.amazonaws.com/assets.datacamp.com/course/Kaggle/train.csv")
9392
test = pd.read_csv("http://s3.amazonaws.com/assets.datacamp.com/course/Kaggle/test.csv")
94-
9593
```
9694

9795
*** =sample_code
9896
```{python}
99-
#Convert the male and female groups to integer form
97+
# Convert the male and female groups to integer form
10098
train["Sex"][train["Sex"] == "male"] = 0
10199
102-
#Impute the Embarked variable
100+
# Impute the Embarked variable
103101
train["Embarked"] =
104102
105-
#Convert the Embarked classes to integer form
103+
# Convert the Embarked classes to integer form
106104
train["Embarked"][train["Embarked"] == "S"] = 0
107105
108106
#Print the Sex and Embarked columns
@@ -111,19 +109,19 @@ train["Embarked"][train["Embarked"] == "S"] = 0
111109

112110
*** =solution
113111
```{python}
114-
#Convert the male and female groups to integer form
112+
# Convert the male and female groups to integer form
115113
train["Sex"][train["Sex"] == "male"] = 0
116114
train["Sex"][train["Sex"] == "female"] = 1
117115
118-
#Impute the Embarked variable
116+
# Impute the Embarked variable
119117
train["Embarked"] = train["Embarked"].fillna("S")
120118
121-
#Convert the Embarked classes to integer form
119+
# Convert the Embarked classes to integer form
122120
train["Embarked"][train["Embarked"] == "S"] = 0
123121
train["Embarked"][train["Embarked"] == "C"] = 1
124122
train["Embarked"][train["Embarked"] == "Q"] = 2
125123
126-
#Print the Sex and Embarked columns
124+
# Print the Sex and Embarked columns
127125
print(train["Sex"])
128126
print(train["Embarked"])
129127
```

0 commit comments

Comments
 (0)