Skip to content

Commit ccdad4b

Browse files
committed
Excercise-1
1 parent 0f4f233 commit ccdad4b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Chapter 1/Excercises/Excercise_1_creating_features_matrix_target_matrix.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"1.Load the dataset into the pandas data frame. To do so, you first need to import the pandas library, and then, use the function pd.read_csv(), as shown below:"
7+
"#### 1.Load the dataset into the pandas data frame. To do so, you first need to import the pandas library, and then, use the function pd.read_csv(), as shown below:"
88
]
99
},
1010
{
@@ -22,7 +22,7 @@
2222
"cell_type": "markdown",
2323
"metadata": {},
2424
"source": [
25-
"2.Print all the column names of the data frame. Using the command df.columns"
25+
"#### 2.Print all the column names of the data frame. Using the command df.columns"
2626
]
2727
},
2828
{
@@ -51,7 +51,7 @@
5151
"cell_type": "markdown",
5252
"metadata": {},
5353
"source": [
54-
"3.Print the index names of the data frame. Using the command df.index"
54+
"#### 3.Print the index names of the data frame. Using the command df.index"
5555
]
5656
},
5757
{
@@ -78,7 +78,7 @@
7878
"cell_type": "markdown",
7979
"metadata": {},
8080
"source": [
81-
"4.Make the address column as an index and reset it back to the original data frame."
81+
"#### 4.Make the address column as an index and reset it back to the original data frame."
8282
]
8383
},
8484
{
@@ -1951,7 +1951,7 @@
19511951
"cell_type": "markdown",
19521952
"metadata": {},
19531953
"source": [
1954-
"5.Retrieve first 2 rows and first 3 columns using a row number and column number. Use iloc function in pandas."
1954+
"#### 5.Retrieve first 4 rows and first 3 columns using a row number and column number. Use iloc function in pandas."
19551955
]
19561956
},
19571957
{
@@ -2041,7 +2041,7 @@
20412041
"cell_type": "markdown",
20422042
"metadata": {},
20432043
"source": [
2044-
"6.Retrieve first 2 rows and Income and Age column using the name of the column. Use the loc function in pandas."
2044+
"#### 6.Retrieve first 2 rows and Income and Age column using the name of the column. Use the loc function in pandas."
20452045
]
20462046
},
20472047
{
@@ -2126,7 +2126,7 @@
21262126
"cell_type": "markdown",
21272127
"metadata": {},
21282128
"source": [
2129-
"7.Create a variable X to store the **independent features**. Use the drop()function to include all features but the dependent or the target variable, which in this case is named Price. \n",
2129+
"#### 7.Create a variable X to store the **independent features**. Use the drop()function to include all features but the dependent or the target variable, which in this case is named Price. \n",
21302130
"\n",
21312131
"\n",
21322132
"Then, print out the top 5 instances of the variable. "
@@ -2253,7 +2253,7 @@
22532253
"cell_type": "markdown",
22542254
"metadata": {},
22552255
"source": [
2256-
"8.Print the shape of your new created feature matrix using the command X.shape. The first value indicates the number of observations in the dataset (5000), and the second value represents the number of features (6)."
2256+
"#### 8.Print the shape of your new created feature matrix using the command X.shape. The first value indicates the number of observations in the dataset (5000), and the second value represents the number of features (6)."
22572257
]
22582258
},
22592259
{
@@ -2281,7 +2281,7 @@
22812281
"cell_type": "markdown",
22822282
"metadata": {},
22832283
"source": [
2284-
"9.Similarly, we will create a variable y that will store the **target values**. We will just use indexing to grab only the target column. Indexing allows you to access a section of a larger element. In this case, we want to grab the column named Price from the data frame df.\n",
2284+
"#### 9.Similarly, we will create a variable y that will store the **target values**. We will just use indexing to grab only the target column. Indexing allows you to access a section of a larger element. In this case, we want to grab the column named Price from the data frame df.\n",
22852285
"\n",
22862286
"Then, print out the top 10 values of the variable."
22872287
]
@@ -2321,7 +2321,7 @@
23212321
"cell_type": "markdown",
23222322
"metadata": {},
23232323
"source": [
2324-
"10.Print the shape of your new variable using the command: y.shape. The shape should be one-dimensional with length equal to the number of observations (5000) only."
2324+
"#### 10.Print the shape of your new variable using the command: y.shape. The shape should be one-dimensional with length equal to the number of observations (5000) only."
23252325
]
23262326
},
23272327
{

0 commit comments

Comments
 (0)