Store the sales price as a float

This commit is contained in:
Alexander Hess 2018-08-29 17:18:57 +02:00
parent c60a901062
commit ffeed18376

View file

@ -30,7 +30,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"2018-08-29 17:09:28 CEST\n",
"2018-08-29 17:18:17 CEST\n",
"\n",
"CPython 3.6.5\n",
"IPython 6.5.0\n",
@ -2285,7 +2285,7 @@
"update_column_descriptions(df.columns)\n",
"# Without any more missing data, cast all numeric\n",
"# columns as floats or integers respectively.\n",
"for column in CONTINUOUS_VARIABLES:\n",
"for column in CONTINUOUS_VARIABLES + [\"SalePrice\"]:\n",
" df[column] = df[column].astype(np.float64)\n",
"for column in DISCRETE_VARIABLES:\n",
" df[column] = df[column].astype(np.int64)"
@ -2595,7 +2595,7 @@
" <td>1960</td>\n",
" <td>1960</td>\n",
" <td>2010</td>\n",
" <td>215000</td>\n",
" <td>215000.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
@ -2677,7 +2677,7 @@
" <td>1961</td>\n",
" <td>1961</td>\n",
" <td>2010</td>\n",
" <td>105000</td>\n",
" <td>105000.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
@ -2759,7 +2759,7 @@
" <td>1958</td>\n",
" <td>1958</td>\n",
" <td>2010</td>\n",
" <td>172000</td>\n",
" <td>172000.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
@ -2841,7 +2841,7 @@
" <td>1968</td>\n",
" <td>1968</td>\n",
" <td>2010</td>\n",
" <td>244000</td>\n",
" <td>244000.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
@ -2923,7 +2923,7 @@
" <td>1997</td>\n",
" <td>1998</td>\n",
" <td>2010</td>\n",
" <td>189900</td>\n",
" <td>189900.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -3060,11 +3060,11 @@
"\n",
" Year Built Year Remod/Add Yr Sold SalePrice \n",
"Order PID \n",
"1 526301100 1960 1960 2010 215000 \n",
"2 526350040 1961 1961 2010 105000 \n",
"3 526351010 1958 1958 2010 172000 \n",
"4 526353030 1968 1968 2010 244000 \n",
"5 527105010 1997 1998 2010 189900 "
"1 526301100 1960 1960 2010 215000.0 \n",
"2 526350040 1961 1961 2010 105000.0 \n",
"3 526351010 1958 1958 2010 172000.0 \n",
"4 526353030 1968 1968 2010 244000.0 \n",
"5 527105010 1997 1998 2010 189900.0 "
]
},
"execution_count": 40,