From ffeed183767a39bd089b84960e65e24d1f6ed5f7 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Wed, 29 Aug 2018 17:18:57 +0200 Subject: [PATCH] Store the sales price as a float --- 1_data_cleaning.ipynb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/1_data_cleaning.ipynb b/1_data_cleaning.ipynb index ed1c466..18e187c 100644 --- a/1_data_cleaning.ipynb +++ b/1_data_cleaning.ipynb @@ -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 @@ " 1960\n", " 1960\n", " 2010\n", - " 215000\n", + " 215000.0\n", " \n", " \n", " 2\n", @@ -2677,7 +2677,7 @@ " 1961\n", " 1961\n", " 2010\n", - " 105000\n", + " 105000.0\n", " \n", " \n", " 3\n", @@ -2759,7 +2759,7 @@ " 1958\n", " 1958\n", " 2010\n", - " 172000\n", + " 172000.0\n", " \n", " \n", " 4\n", @@ -2841,7 +2841,7 @@ " 1968\n", " 1968\n", " 2010\n", - " 244000\n", + " 244000.0\n", " \n", " \n", " 5\n", @@ -2923,7 +2923,7 @@ " 1997\n", " 1998\n", " 2010\n", - " 189900\n", + " 189900.0\n", " \n", " \n", "\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,