fix: regiontype to region type and use categories instead of strings where possible
Browse files
checker.ipynb
ADDED
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [],
|
8 |
+
"source": [
|
9 |
+
"# import json as pandas\n",
|
10 |
+
"import pandas as pd"
|
11 |
+
]
|
12 |
+
},
|
13 |
+
{
|
14 |
+
"cell_type": "code",
|
15 |
+
"execution_count": 27,
|
16 |
+
"metadata": {},
|
17 |
+
"outputs": [
|
18 |
+
{
|
19 |
+
"data": {
|
20 |
+
"text/html": [
|
21 |
+
"<div>\n",
|
22 |
+
"<style scoped>\n",
|
23 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
24 |
+
" vertical-align: middle;\n",
|
25 |
+
" }\n",
|
26 |
+
"\n",
|
27 |
+
" .dataframe tbody tr th {\n",
|
28 |
+
" vertical-align: top;\n",
|
29 |
+
" }\n",
|
30 |
+
"\n",
|
31 |
+
" .dataframe thead th {\n",
|
32 |
+
" text-align: right;\n",
|
33 |
+
" }\n",
|
34 |
+
"</style>\n",
|
35 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
36 |
+
" <thead>\n",
|
37 |
+
" <tr style=\"text-align: right;\">\n",
|
38 |
+
" <th></th>\n",
|
39 |
+
" <th>Region ID</th>\n",
|
40 |
+
" <th>Size Rank</th>\n",
|
41 |
+
" <th>Region</th>\n",
|
42 |
+
" <th>Region Type</th>\n",
|
43 |
+
" <th>Home Type</th>\n",
|
44 |
+
" <th>State</th>\n",
|
45 |
+
" <th>Metro</th>\n",
|
46 |
+
" <th>State Code FIPS</th>\n",
|
47 |
+
" <th>Municipal Code FIPS</th>\n",
|
48 |
+
" <th>Date</th>\n",
|
49 |
+
" <th>Rent (Smoothed)</th>\n",
|
50 |
+
" <th>Rent (Smoothed) (Seasonally Adjusted)</th>\n",
|
51 |
+
" <th>City</th>\n",
|
52 |
+
" <th>County</th>\n",
|
53 |
+
" </tr>\n",
|
54 |
+
" </thead>\n",
|
55 |
+
" <tbody>\n",
|
56 |
+
" <tr>\n",
|
57 |
+
" <th>0</th>\n",
|
58 |
+
" <td>66</td>\n",
|
59 |
+
" <td>146</td>\n",
|
60 |
+
" <td>Ada County</td>\n",
|
61 |
+
" <td>county</td>\n",
|
62 |
+
" <td>all homes plus multifamily</td>\n",
|
63 |
+
" <td>Ada County</td>\n",
|
64 |
+
" <td>Boise City, ID</td>\n",
|
65 |
+
" <td>16.0</td>\n",
|
66 |
+
" <td>1.0</td>\n",
|
67 |
+
" <td>2015-01-31</td>\n",
|
68 |
+
" <td>927.493763</td>\n",
|
69 |
+
" <td>927.493763</td>\n",
|
70 |
+
" <td>None</td>\n",
|
71 |
+
" <td>Ada County</td>\n",
|
72 |
+
" </tr>\n",
|
73 |
+
" <tr>\n",
|
74 |
+
" <th>1</th>\n",
|
75 |
+
" <td>66</td>\n",
|
76 |
+
" <td>146</td>\n",
|
77 |
+
" <td>Ada County</td>\n",
|
78 |
+
" <td>county</td>\n",
|
79 |
+
" <td>all homes plus multifamily</td>\n",
|
80 |
+
" <td>Ada County</td>\n",
|
81 |
+
" <td>Boise City, ID</td>\n",
|
82 |
+
" <td>16.0</td>\n",
|
83 |
+
" <td>1.0</td>\n",
|
84 |
+
" <td>2015-02-28</td>\n",
|
85 |
+
" <td>931.690623</td>\n",
|
86 |
+
" <td>931.690623</td>\n",
|
87 |
+
" <td>None</td>\n",
|
88 |
+
" <td>Ada County</td>\n",
|
89 |
+
" </tr>\n",
|
90 |
+
" <tr>\n",
|
91 |
+
" <th>2</th>\n",
|
92 |
+
" <td>66</td>\n",
|
93 |
+
" <td>146</td>\n",
|
94 |
+
" <td>Ada County</td>\n",
|
95 |
+
" <td>county</td>\n",
|
96 |
+
" <td>all homes plus multifamily</td>\n",
|
97 |
+
" <td>Ada County</td>\n",
|
98 |
+
" <td>Boise City, ID</td>\n",
|
99 |
+
" <td>16.0</td>\n",
|
100 |
+
" <td>1.0</td>\n",
|
101 |
+
" <td>2015-03-31</td>\n",
|
102 |
+
" <td>932.568601</td>\n",
|
103 |
+
" <td>932.568601</td>\n",
|
104 |
+
" <td>None</td>\n",
|
105 |
+
" <td>Ada County</td>\n",
|
106 |
+
" </tr>\n",
|
107 |
+
" <tr>\n",
|
108 |
+
" <th>3</th>\n",
|
109 |
+
" <td>66</td>\n",
|
110 |
+
" <td>146</td>\n",
|
111 |
+
" <td>Ada County</td>\n",
|
112 |
+
" <td>county</td>\n",
|
113 |
+
" <td>all homes plus multifamily</td>\n",
|
114 |
+
" <td>Ada County</td>\n",
|
115 |
+
" <td>Boise City, ID</td>\n",
|
116 |
+
" <td>16.0</td>\n",
|
117 |
+
" <td>1.0</td>\n",
|
118 |
+
" <td>2015-04-30</td>\n",
|
119 |
+
" <td>933.148134</td>\n",
|
120 |
+
" <td>933.148134</td>\n",
|
121 |
+
" <td>None</td>\n",
|
122 |
+
" <td>Ada County</td>\n",
|
123 |
+
" </tr>\n",
|
124 |
+
" <tr>\n",
|
125 |
+
" <th>4</th>\n",
|
126 |
+
" <td>66</td>\n",
|
127 |
+
" <td>146</td>\n",
|
128 |
+
" <td>Ada County</td>\n",
|
129 |
+
" <td>county</td>\n",
|
130 |
+
" <td>all homes plus multifamily</td>\n",
|
131 |
+
" <td>Ada County</td>\n",
|
132 |
+
" <td>Boise City, ID</td>\n",
|
133 |
+
" <td>16.0</td>\n",
|
134 |
+
" <td>1.0</td>\n",
|
135 |
+
" <td>2015-05-31</td>\n",
|
136 |
+
" <td>941.045724</td>\n",
|
137 |
+
" <td>941.045724</td>\n",
|
138 |
+
" <td>None</td>\n",
|
139 |
+
" <td>Ada County</td>\n",
|
140 |
+
" </tr>\n",
|
141 |
+
" <tr>\n",
|
142 |
+
" <th>...</th>\n",
|
143 |
+
" <td>...</td>\n",
|
144 |
+
" <td>...</td>\n",
|
145 |
+
" <td>...</td>\n",
|
146 |
+
" <td>...</td>\n",
|
147 |
+
" <td>...</td>\n",
|
148 |
+
" <td>...</td>\n",
|
149 |
+
" <td>...</td>\n",
|
150 |
+
" <td>...</td>\n",
|
151 |
+
" <td>...</td>\n",
|
152 |
+
" <td>...</td>\n",
|
153 |
+
" <td>...</td>\n",
|
154 |
+
" <td>...</td>\n",
|
155 |
+
" <td>...</td>\n",
|
156 |
+
" <td>...</td>\n",
|
157 |
+
" </tr>\n",
|
158 |
+
" <tr>\n",
|
159 |
+
" <th>1258735</th>\n",
|
160 |
+
" <td>857850</td>\n",
|
161 |
+
" <td>713</td>\n",
|
162 |
+
" <td>Cherry Hill</td>\n",
|
163 |
+
" <td>city</td>\n",
|
164 |
+
" <td>all homes plus multifamily</td>\n",
|
165 |
+
" <td>Camden County</td>\n",
|
166 |
+
" <td>Philadelphia-Camden-Wilmington, PA-NJ-DE-MD</td>\n",
|
167 |
+
" <td>NaN</td>\n",
|
168 |
+
" <td>NaN</td>\n",
|
169 |
+
" <td>2023-08-31</td>\n",
|
170 |
+
" <td>2291.604800</td>\n",
|
171 |
+
" <td>2244.961006</td>\n",
|
172 |
+
" <td>Cherry Hill</td>\n",
|
173 |
+
" <td>None</td>\n",
|
174 |
+
" </tr>\n",
|
175 |
+
" <tr>\n",
|
176 |
+
" <th>1258736</th>\n",
|
177 |
+
" <td>857850</td>\n",
|
178 |
+
" <td>713</td>\n",
|
179 |
+
" <td>Cherry Hill</td>\n",
|
180 |
+
" <td>city</td>\n",
|
181 |
+
" <td>all homes plus multifamily</td>\n",
|
182 |
+
" <td>Camden County</td>\n",
|
183 |
+
" <td>Philadelphia-Camden-Wilmington, PA-NJ-DE-MD</td>\n",
|
184 |
+
" <td>NaN</td>\n",
|
185 |
+
" <td>NaN</td>\n",
|
186 |
+
" <td>2023-09-30</td>\n",
|
187 |
+
" <td>2296.188906</td>\n",
|
188 |
+
" <td>2254.213172</td>\n",
|
189 |
+
" <td>Cherry Hill</td>\n",
|
190 |
+
" <td>None</td>\n",
|
191 |
+
" </tr>\n",
|
192 |
+
" <tr>\n",
|
193 |
+
" <th>1258737</th>\n",
|
194 |
+
" <td>857850</td>\n",
|
195 |
+
" <td>713</td>\n",
|
196 |
+
" <td>Cherry Hill</td>\n",
|
197 |
+
" <td>city</td>\n",
|
198 |
+
" <td>all homes plus multifamily</td>\n",
|
199 |
+
" <td>Camden County</td>\n",
|
200 |
+
" <td>Philadelphia-Camden-Wilmington, PA-NJ-DE-MD</td>\n",
|
201 |
+
" <td>NaN</td>\n",
|
202 |
+
" <td>NaN</td>\n",
|
203 |
+
" <td>2023-10-31</td>\n",
|
204 |
+
" <td>2292.270938</td>\n",
|
205 |
+
" <td>2261.540446</td>\n",
|
206 |
+
" <td>Cherry Hill</td>\n",
|
207 |
+
" <td>None</td>\n",
|
208 |
+
" </tr>\n",
|
209 |
+
" <tr>\n",
|
210 |
+
" <th>1258738</th>\n",
|
211 |
+
" <td>857850</td>\n",
|
212 |
+
" <td>713</td>\n",
|
213 |
+
" <td>Cherry Hill</td>\n",
|
214 |
+
" <td>city</td>\n",
|
215 |
+
" <td>all homes plus multifamily</td>\n",
|
216 |
+
" <td>Camden County</td>\n",
|
217 |
+
" <td>Philadelphia-Camden-Wilmington, PA-NJ-DE-MD</td>\n",
|
218 |
+
" <td>NaN</td>\n",
|
219 |
+
" <td>NaN</td>\n",
|
220 |
+
" <td>2023-11-30</td>\n",
|
221 |
+
" <td>2253.417140</td>\n",
|
222 |
+
" <td>2257.956024</td>\n",
|
223 |
+
" <td>Cherry Hill</td>\n",
|
224 |
+
" <td>None</td>\n",
|
225 |
+
" </tr>\n",
|
226 |
+
" <tr>\n",
|
227 |
+
" <th>1258739</th>\n",
|
228 |
+
" <td>857850</td>\n",
|
229 |
+
" <td>713</td>\n",
|
230 |
+
" <td>Cherry Hill</td>\n",
|
231 |
+
" <td>city</td>\n",
|
232 |
+
" <td>all homes plus multifamily</td>\n",
|
233 |
+
" <td>Camden County</td>\n",
|
234 |
+
" <td>Philadelphia-Camden-Wilmington, PA-NJ-DE-MD</td>\n",
|
235 |
+
" <td>NaN</td>\n",
|
236 |
+
" <td>NaN</td>\n",
|
237 |
+
" <td>2023-12-31</td>\n",
|
238 |
+
" <td>2280.830303</td>\n",
|
239 |
+
" <td>2280.830303</td>\n",
|
240 |
+
" <td>Cherry Hill</td>\n",
|
241 |
+
" <td>None</td>\n",
|
242 |
+
" </tr>\n",
|
243 |
+
" </tbody>\n",
|
244 |
+
"</table>\n",
|
245 |
+
"<p>1258740 rows × 14 columns</p>\n",
|
246 |
+
"</div>"
|
247 |
+
],
|
248 |
+
"text/plain": [
|
249 |
+
" Region ID Size Rank Region Region Type \\\n",
|
250 |
+
"0 66 146 Ada County county \n",
|
251 |
+
"1 66 146 Ada County county \n",
|
252 |
+
"2 66 146 Ada County county \n",
|
253 |
+
"3 66 146 Ada County county \n",
|
254 |
+
"4 66 146 Ada County county \n",
|
255 |
+
"... ... ... ... ... \n",
|
256 |
+
"1258735 857850 713 Cherry Hill city \n",
|
257 |
+
"1258736 857850 713 Cherry Hill city \n",
|
258 |
+
"1258737 857850 713 Cherry Hill city \n",
|
259 |
+
"1258738 857850 713 Cherry Hill city \n",
|
260 |
+
"1258739 857850 713 Cherry Hill city \n",
|
261 |
+
"\n",
|
262 |
+
" Home Type State \\\n",
|
263 |
+
"0 all homes plus multifamily Ada County \n",
|
264 |
+
"1 all homes plus multifamily Ada County \n",
|
265 |
+
"2 all homes plus multifamily Ada County \n",
|
266 |
+
"3 all homes plus multifamily Ada County \n",
|
267 |
+
"4 all homes plus multifamily Ada County \n",
|
268 |
+
"... ... ... \n",
|
269 |
+
"1258735 all homes plus multifamily Camden County \n",
|
270 |
+
"1258736 all homes plus multifamily Camden County \n",
|
271 |
+
"1258737 all homes plus multifamily Camden County \n",
|
272 |
+
"1258738 all homes plus multifamily Camden County \n",
|
273 |
+
"1258739 all homes plus multifamily Camden County \n",
|
274 |
+
"\n",
|
275 |
+
" Metro State Code FIPS \\\n",
|
276 |
+
"0 Boise City, ID 16.0 \n",
|
277 |
+
"1 Boise City, ID 16.0 \n",
|
278 |
+
"2 Boise City, ID 16.0 \n",
|
279 |
+
"3 Boise City, ID 16.0 \n",
|
280 |
+
"4 Boise City, ID 16.0 \n",
|
281 |
+
"... ... ... \n",
|
282 |
+
"1258735 Philadelphia-Camden-Wilmington, PA-NJ-DE-MD NaN \n",
|
283 |
+
"1258736 Philadelphia-Camden-Wilmington, PA-NJ-DE-MD NaN \n",
|
284 |
+
"1258737 Philadelphia-Camden-Wilmington, PA-NJ-DE-MD NaN \n",
|
285 |
+
"1258738 Philadelphia-Camden-Wilmington, PA-NJ-DE-MD NaN \n",
|
286 |
+
"1258739 Philadelphia-Camden-Wilmington, PA-NJ-DE-MD NaN \n",
|
287 |
+
"\n",
|
288 |
+
" Municipal Code FIPS Date Rent (Smoothed) \\\n",
|
289 |
+
"0 1.0 2015-01-31 927.493763 \n",
|
290 |
+
"1 1.0 2015-02-28 931.690623 \n",
|
291 |
+
"2 1.0 2015-03-31 932.568601 \n",
|
292 |
+
"3 1.0 2015-04-30 933.148134 \n",
|
293 |
+
"4 1.0 2015-05-31 941.045724 \n",
|
294 |
+
"... ... ... ... \n",
|
295 |
+
"1258735 NaN 2023-08-31 2291.604800 \n",
|
296 |
+
"1258736 NaN 2023-09-30 2296.188906 \n",
|
297 |
+
"1258737 NaN 2023-10-31 2292.270938 \n",
|
298 |
+
"1258738 NaN 2023-11-30 2253.417140 \n",
|
299 |
+
"1258739 NaN 2023-12-31 2280.830303 \n",
|
300 |
+
"\n",
|
301 |
+
" Rent (Smoothed) (Seasonally Adjusted) City County \n",
|
302 |
+
"0 927.493763 None Ada County \n",
|
303 |
+
"1 931.690623 None Ada County \n",
|
304 |
+
"2 932.568601 None Ada County \n",
|
305 |
+
"3 933.148134 None Ada County \n",
|
306 |
+
"4 941.045724 None Ada County \n",
|
307 |
+
"... ... ... ... \n",
|
308 |
+
"1258735 2244.961006 Cherry Hill None \n",
|
309 |
+
"1258736 2254.213172 Cherry Hill None \n",
|
310 |
+
"1258737 2261.540446 Cherry Hill None \n",
|
311 |
+
"1258738 2257.956024 Cherry Hill None \n",
|
312 |
+
"1258739 2280.830303 Cherry Hill None \n",
|
313 |
+
"\n",
|
314 |
+
"[1258740 rows x 14 columns]"
|
315 |
+
]
|
316 |
+
},
|
317 |
+
"execution_count": 27,
|
318 |
+
"metadata": {},
|
319 |
+
"output_type": "execute_result"
|
320 |
+
}
|
321 |
+
],
|
322 |
+
"source": [
|
323 |
+
"# read the data\n",
|
324 |
+
"x = pd.read_json(\"processed/rentals/final5.jsonl\", lines=True)\n",
|
325 |
+
"x"
|
326 |
+
]
|
327 |
+
},
|
328 |
+
{
|
329 |
+
"cell_type": "code",
|
330 |
+
"execution_count": 28,
|
331 |
+
"metadata": {},
|
332 |
+
"outputs": [
|
333 |
+
{
|
334 |
+
"data": {
|
335 |
+
"text/plain": [
|
336 |
+
"array(['county', 'city', 'zip', 'country', 'msa'], dtype=object)"
|
337 |
+
]
|
338 |
+
},
|
339 |
+
"execution_count": 28,
|
340 |
+
"metadata": {},
|
341 |
+
"output_type": "execute_result"
|
342 |
+
}
|
343 |
+
],
|
344 |
+
"source": [
|
345 |
+
"# get unique values for column\n",
|
346 |
+
"x[\"Region Type\"].unique()"
|
347 |
+
]
|
348 |
+
},
|
349 |
+
{
|
350 |
+
"cell_type": "code",
|
351 |
+
"execution_count": 29,
|
352 |
+
"metadata": {},
|
353 |
+
"outputs": [
|
354 |
+
{
|
355 |
+
"data": {
|
356 |
+
"text/plain": [
|
357 |
+
"array(['all homes plus multifamily', 'SFR', 'multifamily'], dtype=object)"
|
358 |
+
]
|
359 |
+
},
|
360 |
+
"execution_count": 29,
|
361 |
+
"metadata": {},
|
362 |
+
"output_type": "execute_result"
|
363 |
+
}
|
364 |
+
],
|
365 |
+
"source": [
|
366 |
+
"x[\"Home Type\"].unique()"
|
367 |
+
]
|
368 |
+
},
|
369 |
+
{
|
370 |
+
"cell_type": "code",
|
371 |
+
"execution_count": 15,
|
372 |
+
"metadata": {},
|
373 |
+
"outputs": [
|
374 |
+
{
|
375 |
+
"data": {
|
376 |
+
"text/plain": [
|
377 |
+
"array(['1-Bedroom', '2-Bedrooms', '3-Bedrooms', '4-Bedrooms',\n",
|
378 |
+
" '5+-Bedrooms', 'All Bedrooms'], dtype=object)"
|
379 |
+
]
|
380 |
+
},
|
381 |
+
"execution_count": 15,
|
382 |
+
"metadata": {},
|
383 |
+
"output_type": "execute_result"
|
384 |
+
}
|
385 |
+
],
|
386 |
+
"source": [
|
387 |
+
"x[\"Bedroom Count\"].unique()"
|
388 |
+
]
|
389 |
+
}
|
390 |
+
],
|
391 |
+
"metadata": {
|
392 |
+
"kernelspec": {
|
393 |
+
"display_name": "sta663",
|
394 |
+
"language": "python",
|
395 |
+
"name": "python3"
|
396 |
+
},
|
397 |
+
"language_info": {
|
398 |
+
"codemirror_mode": {
|
399 |
+
"name": "ipython",
|
400 |
+
"version": 3
|
401 |
+
},
|
402 |
+
"file_extension": ".py",
|
403 |
+
"mimetype": "text/x-python",
|
404 |
+
"name": "python",
|
405 |
+
"nbconvert_exporter": "python",
|
406 |
+
"pygments_lexer": "ipython3",
|
407 |
+
"version": "3.12.2"
|
408 |
+
}
|
409 |
+
},
|
410 |
+
"nbformat": 4,
|
411 |
+
"nbformat_minor": 2
|
412 |
+
}
|
processed/home_values_forecasts/final5.jsonl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a8627505370927a63475f06adf6470710cf92be0a1a2184497b56e8d00cabd56
|
3 |
+
size 14050125
|
processors/{home_value_forecasts.ipynb → home_values_forecasts.ipynb}
RENAMED
@@ -419,336 +419,19 @@
|
|
419 |
},
|
420 |
{
|
421 |
"cell_type": "code",
|
422 |
-
"execution_count":
|
423 |
"metadata": {},
|
424 |
"outputs": [
|
425 |
{
|
426 |
-
"
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
" vertical-align: top;\n",
|
436 |
-
" }\n",
|
437 |
-
"\n",
|
438 |
-
" .dataframe thead th {\n",
|
439 |
-
" text-align: right;\n",
|
440 |
-
" }\n",
|
441 |
-
"</style>\n",
|
442 |
-
"<table border=\"1\" class=\"dataframe\">\n",
|
443 |
-
" <thead>\n",
|
444 |
-
" <tr style=\"text-align: right;\">\n",
|
445 |
-
" <th></th>\n",
|
446 |
-
" <th>Region ID</th>\n",
|
447 |
-
" <th>Size Rank</th>\n",
|
448 |
-
" <th>Region</th>\n",
|
449 |
-
" <th>RegionType</th>\n",
|
450 |
-
" <th>State</th>\n",
|
451 |
-
" <th>City</th>\n",
|
452 |
-
" <th>Metro</th>\n",
|
453 |
-
" <th>County</th>\n",
|
454 |
-
" <th>Date</th>\n",
|
455 |
-
" <th>Month Over Month % (Smoothed) (Seasonally Adjusted)</th>\n",
|
456 |
-
" <th>Quarter Over Quarter % (Smoothed) (Seasonally Adjusted)</th>\n",
|
457 |
-
" <th>Year Over Year % (Smoothed) (Seasonally Adjusted)</th>\n",
|
458 |
-
" <th>Month Over Month %</th>\n",
|
459 |
-
" <th>Quarter Over Quarter %</th>\n",
|
460 |
-
" <th>Year Over Year %</th>\n",
|
461 |
-
" </tr>\n",
|
462 |
-
" </thead>\n",
|
463 |
-
" <tbody>\n",
|
464 |
-
" <tr>\n",
|
465 |
-
" <th>0</th>\n",
|
466 |
-
" <td>58001</td>\n",
|
467 |
-
" <td>30490</td>\n",
|
468 |
-
" <td>501</td>\n",
|
469 |
-
" <td>zip</td>\n",
|
470 |
-
" <td>NY</td>\n",
|
471 |
-
" <td>Holtsville</td>\n",
|
472 |
-
" <td>New York-Newark-Jersey City, NY-NJ-PA</td>\n",
|
473 |
-
" <td>Suffolk County</td>\n",
|
474 |
-
" <td>2023-12-31</td>\n",
|
475 |
-
" <td>NaN</td>\n",
|
476 |
-
" <td>NaN</td>\n",
|
477 |
-
" <td>NaN</td>\n",
|
478 |
-
" <td>-0.7</td>\n",
|
479 |
-
" <td>-0.9</td>\n",
|
480 |
-
" <td>0.6</td>\n",
|
481 |
-
" </tr>\n",
|
482 |
-
" <tr>\n",
|
483 |
-
" <th>1</th>\n",
|
484 |
-
" <td>58002</td>\n",
|
485 |
-
" <td>30490</td>\n",
|
486 |
-
" <td>544</td>\n",
|
487 |
-
" <td>zip</td>\n",
|
488 |
-
" <td>NY</td>\n",
|
489 |
-
" <td>Holtsville</td>\n",
|
490 |
-
" <td>New York-Newark-Jersey City, NY-NJ-PA</td>\n",
|
491 |
-
" <td>Suffolk County</td>\n",
|
492 |
-
" <td>2023-12-31</td>\n",
|
493 |
-
" <td>NaN</td>\n",
|
494 |
-
" <td>NaN</td>\n",
|
495 |
-
" <td>NaN</td>\n",
|
496 |
-
" <td>-0.7</td>\n",
|
497 |
-
" <td>-0.9</td>\n",
|
498 |
-
" <td>0.6</td>\n",
|
499 |
-
" </tr>\n",
|
500 |
-
" <tr>\n",
|
501 |
-
" <th>2</th>\n",
|
502 |
-
" <td>58196</td>\n",
|
503 |
-
" <td>7440</td>\n",
|
504 |
-
" <td>1001</td>\n",
|
505 |
-
" <td>zip</td>\n",
|
506 |
-
" <td>MA</td>\n",
|
507 |
-
" <td>Agawam</td>\n",
|
508 |
-
" <td>Springfield, MA</td>\n",
|
509 |
-
" <td>Hampden County</td>\n",
|
510 |
-
" <td>2023-12-31</td>\n",
|
511 |
-
" <td>0.4</td>\n",
|
512 |
-
" <td>0.9</td>\n",
|
513 |
-
" <td>3.2</td>\n",
|
514 |
-
" <td>-0.6</td>\n",
|
515 |
-
" <td>0.0</td>\n",
|
516 |
-
" <td>3.0</td>\n",
|
517 |
-
" </tr>\n",
|
518 |
-
" <tr>\n",
|
519 |
-
" <th>3</th>\n",
|
520 |
-
" <td>58197</td>\n",
|
521 |
-
" <td>3911</td>\n",
|
522 |
-
" <td>1002</td>\n",
|
523 |
-
" <td>zip</td>\n",
|
524 |
-
" <td>MA</td>\n",
|
525 |
-
" <td>Amherst</td>\n",
|
526 |
-
" <td>Springfield, MA</td>\n",
|
527 |
-
" <td>Hampshire County</td>\n",
|
528 |
-
" <td>2023-12-31</td>\n",
|
529 |
-
" <td>0.2</td>\n",
|
530 |
-
" <td>0.7</td>\n",
|
531 |
-
" <td>2.7</td>\n",
|
532 |
-
" <td>-0.6</td>\n",
|
533 |
-
" <td>0.0</td>\n",
|
534 |
-
" <td>2.9</td>\n",
|
535 |
-
" </tr>\n",
|
536 |
-
" <tr>\n",
|
537 |
-
" <th>4</th>\n",
|
538 |
-
" <td>58198</td>\n",
|
539 |
-
" <td>8838</td>\n",
|
540 |
-
" <td>1003</td>\n",
|
541 |
-
" <td>zip</td>\n",
|
542 |
-
" <td>MA</td>\n",
|
543 |
-
" <td>Amherst</td>\n",
|
544 |
-
" <td>Springfield, MA</td>\n",
|
545 |
-
" <td>Hampshire County</td>\n",
|
546 |
-
" <td>2023-12-31</td>\n",
|
547 |
-
" <td>NaN</td>\n",
|
548 |
-
" <td>NaN</td>\n",
|
549 |
-
" <td>NaN</td>\n",
|
550 |
-
" <td>-0.7</td>\n",
|
551 |
-
" <td>0.0</td>\n",
|
552 |
-
" <td>3.4</td>\n",
|
553 |
-
" </tr>\n",
|
554 |
-
" <tr>\n",
|
555 |
-
" <th>...</th>\n",
|
556 |
-
" <td>...</td>\n",
|
557 |
-
" <td>...</td>\n",
|
558 |
-
" <td>...</td>\n",
|
559 |
-
" <td>...</td>\n",
|
560 |
-
" <td>...</td>\n",
|
561 |
-
" <td>...</td>\n",
|
562 |
-
" <td>...</td>\n",
|
563 |
-
" <td>...</td>\n",
|
564 |
-
" <td>...</td>\n",
|
565 |
-
" <td>...</td>\n",
|
566 |
-
" <td>...</td>\n",
|
567 |
-
" <td>...</td>\n",
|
568 |
-
" <td>...</td>\n",
|
569 |
-
" <td>...</td>\n",
|
570 |
-
" <td>...</td>\n",
|
571 |
-
" </tr>\n",
|
572 |
-
" <tr>\n",
|
573 |
-
" <th>31849</th>\n",
|
574 |
-
" <td>827279</td>\n",
|
575 |
-
" <td>7779</td>\n",
|
576 |
-
" <td>72405</td>\n",
|
577 |
-
" <td>zip</td>\n",
|
578 |
-
" <td>AR</td>\n",
|
579 |
-
" <td>Jonesboro</td>\n",
|
580 |
-
" <td>Jonesboro, AR</td>\n",
|
581 |
-
" <td>Craighead County</td>\n",
|
582 |
-
" <td>2023-12-31</td>\n",
|
583 |
-
" <td>NaN</td>\n",
|
584 |
-
" <td>NaN</td>\n",
|
585 |
-
" <td>NaN</td>\n",
|
586 |
-
" <td>-0.7</td>\n",
|
587 |
-
" <td>0.0</td>\n",
|
588 |
-
" <td>2.5</td>\n",
|
589 |
-
" </tr>\n",
|
590 |
-
" <tr>\n",
|
591 |
-
" <th>31850</th>\n",
|
592 |
-
" <td>834213</td>\n",
|
593 |
-
" <td>30490</td>\n",
|
594 |
-
" <td>11437</td>\n",
|
595 |
-
" <td>zip</td>\n",
|
596 |
-
" <td>NY</td>\n",
|
597 |
-
" <td>New York</td>\n",
|
598 |
-
" <td>New York-Newark-Jersey City, NY-NJ-PA</td>\n",
|
599 |
-
" <td>Queens County</td>\n",
|
600 |
-
" <td>2023-12-31</td>\n",
|
601 |
-
" <td>NaN</td>\n",
|
602 |
-
" <td>NaN</td>\n",
|
603 |
-
" <td>NaN</td>\n",
|
604 |
-
" <td>-0.7</td>\n",
|
605 |
-
" <td>-0.9</td>\n",
|
606 |
-
" <td>0.6</td>\n",
|
607 |
-
" </tr>\n",
|
608 |
-
" <tr>\n",
|
609 |
-
" <th>31851</th>\n",
|
610 |
-
" <td>845914</td>\n",
|
611 |
-
" <td>6361</td>\n",
|
612 |
-
" <td>85288</td>\n",
|
613 |
-
" <td>zip</td>\n",
|
614 |
-
" <td>AZ</td>\n",
|
615 |
-
" <td>Tempe</td>\n",
|
616 |
-
" <td>Phoenix-Mesa-Chandler, AZ</td>\n",
|
617 |
-
" <td>Maricopa County</td>\n",
|
618 |
-
" <td>2023-12-31</td>\n",
|
619 |
-
" <td>NaN</td>\n",
|
620 |
-
" <td>NaN</td>\n",
|
621 |
-
" <td>NaN</td>\n",
|
622 |
-
" <td>-1.0</td>\n",
|
623 |
-
" <td>0.0</td>\n",
|
624 |
-
" <td>4.5</td>\n",
|
625 |
-
" </tr>\n",
|
626 |
-
" <tr>\n",
|
627 |
-
" <th>31852</th>\n",
|
628 |
-
" <td>847854</td>\n",
|
629 |
-
" <td>39992</td>\n",
|
630 |
-
" <td>20598</td>\n",
|
631 |
-
" <td>zip</td>\n",
|
632 |
-
" <td>VA</td>\n",
|
633 |
-
" <td>Arlington</td>\n",
|
634 |
-
" <td>Washington-Arlington-Alexandria, DC-VA-MD-WV</td>\n",
|
635 |
-
" <td>Arlington County</td>\n",
|
636 |
-
" <td>2023-12-31</td>\n",
|
637 |
-
" <td>NaN</td>\n",
|
638 |
-
" <td>NaN</td>\n",
|
639 |
-
" <td>NaN</td>\n",
|
640 |
-
" <td>-0.4</td>\n",
|
641 |
-
" <td>0.9</td>\n",
|
642 |
-
" <td>1.2</td>\n",
|
643 |
-
" </tr>\n",
|
644 |
-
" <tr>\n",
|
645 |
-
" <th>31853</th>\n",
|
646 |
-
" <td>847855</td>\n",
|
647 |
-
" <td>30490</td>\n",
|
648 |
-
" <td>34249</td>\n",
|
649 |
-
" <td>zip</td>\n",
|
650 |
-
" <td>FL</td>\n",
|
651 |
-
" <td>Sarasota</td>\n",
|
652 |
-
" <td>North Port-Sarasota-Bradenton, FL</td>\n",
|
653 |
-
" <td>Sarasota County</td>\n",
|
654 |
-
" <td>2023-12-31</td>\n",
|
655 |
-
" <td>NaN</td>\n",
|
656 |
-
" <td>NaN</td>\n",
|
657 |
-
" <td>NaN</td>\n",
|
658 |
-
" <td>-0.9</td>\n",
|
659 |
-
" <td>-0.1</td>\n",
|
660 |
-
" <td>5.4</td>\n",
|
661 |
-
" </tr>\n",
|
662 |
-
" </tbody>\n",
|
663 |
-
"</table>\n",
|
664 |
-
"<p>31854 rows × 15 columns</p>\n",
|
665 |
-
"</div>"
|
666 |
-
],
|
667 |
-
"text/plain": [
|
668 |
-
" Region ID Size Rank Region RegionType State City \\\n",
|
669 |
-
"0 58001 30490 501 zip NY Holtsville \n",
|
670 |
-
"1 58002 30490 544 zip NY Holtsville \n",
|
671 |
-
"2 58196 7440 1001 zip MA Agawam \n",
|
672 |
-
"3 58197 3911 1002 zip MA Amherst \n",
|
673 |
-
"4 58198 8838 1003 zip MA Amherst \n",
|
674 |
-
"... ... ... ... ... ... ... \n",
|
675 |
-
"31849 827279 7779 72405 zip AR Jonesboro \n",
|
676 |
-
"31850 834213 30490 11437 zip NY New York \n",
|
677 |
-
"31851 845914 6361 85288 zip AZ Tempe \n",
|
678 |
-
"31852 847854 39992 20598 zip VA Arlington \n",
|
679 |
-
"31853 847855 30490 34249 zip FL Sarasota \n",
|
680 |
-
"\n",
|
681 |
-
" Metro County \\\n",
|
682 |
-
"0 New York-Newark-Jersey City, NY-NJ-PA Suffolk County \n",
|
683 |
-
"1 New York-Newark-Jersey City, NY-NJ-PA Suffolk County \n",
|
684 |
-
"2 Springfield, MA Hampden County \n",
|
685 |
-
"3 Springfield, MA Hampshire County \n",
|
686 |
-
"4 Springfield, MA Hampshire County \n",
|
687 |
-
"... ... ... \n",
|
688 |
-
"31849 Jonesboro, AR Craighead County \n",
|
689 |
-
"31850 New York-Newark-Jersey City, NY-NJ-PA Queens County \n",
|
690 |
-
"31851 Phoenix-Mesa-Chandler, AZ Maricopa County \n",
|
691 |
-
"31852 Washington-Arlington-Alexandria, DC-VA-MD-WV Arlington County \n",
|
692 |
-
"31853 North Port-Sarasota-Bradenton, FL Sarasota County \n",
|
693 |
-
"\n",
|
694 |
-
" Date Month Over Month % (Smoothed) (Seasonally Adjusted) \\\n",
|
695 |
-
"0 2023-12-31 NaN \n",
|
696 |
-
"1 2023-12-31 NaN \n",
|
697 |
-
"2 2023-12-31 0.4 \n",
|
698 |
-
"3 2023-12-31 0.2 \n",
|
699 |
-
"4 2023-12-31 NaN \n",
|
700 |
-
"... ... ... \n",
|
701 |
-
"31849 2023-12-31 NaN \n",
|
702 |
-
"31850 2023-12-31 NaN \n",
|
703 |
-
"31851 2023-12-31 NaN \n",
|
704 |
-
"31852 2023-12-31 NaN \n",
|
705 |
-
"31853 2023-12-31 NaN \n",
|
706 |
-
"\n",
|
707 |
-
" Quarter Over Quarter % (Smoothed) (Seasonally Adjusted) \\\n",
|
708 |
-
"0 NaN \n",
|
709 |
-
"1 NaN \n",
|
710 |
-
"2 0.9 \n",
|
711 |
-
"3 0.7 \n",
|
712 |
-
"4 NaN \n",
|
713 |
-
"... ... \n",
|
714 |
-
"31849 NaN \n",
|
715 |
-
"31850 NaN \n",
|
716 |
-
"31851 NaN \n",
|
717 |
-
"31852 NaN \n",
|
718 |
-
"31853 NaN \n",
|
719 |
-
"\n",
|
720 |
-
" Year Over Year % (Smoothed) (Seasonally Adjusted) Month Over Month % \\\n",
|
721 |
-
"0 NaN -0.7 \n",
|
722 |
-
"1 NaN -0.7 \n",
|
723 |
-
"2 3.2 -0.6 \n",
|
724 |
-
"3 2.7 -0.6 \n",
|
725 |
-
"4 NaN -0.7 \n",
|
726 |
-
"... ... ... \n",
|
727 |
-
"31849 NaN -0.7 \n",
|
728 |
-
"31850 NaN -0.7 \n",
|
729 |
-
"31851 NaN -1.0 \n",
|
730 |
-
"31852 NaN -0.4 \n",
|
731 |
-
"31853 NaN -0.9 \n",
|
732 |
-
"\n",
|
733 |
-
" Quarter Over Quarter % Year Over Year % \n",
|
734 |
-
"0 -0.9 0.6 \n",
|
735 |
-
"1 -0.9 0.6 \n",
|
736 |
-
"2 0.0 3.0 \n",
|
737 |
-
"3 0.0 2.9 \n",
|
738 |
-
"4 0.0 3.4 \n",
|
739 |
-
"... ... ... \n",
|
740 |
-
"31849 0.0 2.5 \n",
|
741 |
-
"31850 -0.9 0.6 \n",
|
742 |
-
"31851 0.0 4.5 \n",
|
743 |
-
"31852 0.9 1.2 \n",
|
744 |
-
"31853 -0.1 5.4 \n",
|
745 |
-
"\n",
|
746 |
-
"[31854 rows x 15 columns]"
|
747 |
-
]
|
748 |
-
},
|
749 |
-
"execution_count": 4,
|
750 |
-
"metadata": {},
|
751 |
-
"output_type": "execute_result"
|
752 |
}
|
753 |
],
|
754 |
"source": [
|
@@ -760,6 +443,7 @@
|
|
760 |
" \"CountyName\": \"County\",\n",
|
761 |
" \"BaseDate\": \"Date\",\n",
|
762 |
" \"RegionName\": \"Region\",\n",
|
|
|
763 |
" \"RegionID\": \"Region ID\",\n",
|
764 |
" \"SizeRank\": \"Size Rank\",\n",
|
765 |
" }\n",
|
@@ -767,7 +451,7 @@
|
|
767 |
"\n",
|
768 |
"# iterate over rows of final_df and populate State and City columns if the regionType is msa\n",
|
769 |
"for index, row in final_df.iterrows():\n",
|
770 |
-
" if row[\"
|
771 |
" regionName = row[\"Region\"]\n",
|
772 |
" # final_df.at[index, 'Metro'] = regionName\n",
|
773 |
"\n",
|
|
|
419 |
},
|
420 |
{
|
421 |
"cell_type": "code",
|
422 |
+
"execution_count": 1,
|
423 |
"metadata": {},
|
424 |
"outputs": [
|
425 |
{
|
426 |
+
"ename": "NameError",
|
427 |
+
"evalue": "name 'combined_df' is not defined",
|
428 |
+
"output_type": "error",
|
429 |
+
"traceback": [
|
430 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
431 |
+
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
|
432 |
+
"Cell \u001b[0;32mIn[1], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# Adjust columns\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m final_df \u001b[38;5;241m=\u001b[39m \u001b[43mcombined_df\u001b[49m\n\u001b[1;32m 3\u001b[0m final_df \u001b[38;5;241m=\u001b[39m combined_df\u001b[38;5;241m.\u001b[39mdrop(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mStateName\u001b[39m\u001b[38;5;124m\"\u001b[39m, axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m)\n\u001b[1;32m 4\u001b[0m final_df \u001b[38;5;241m=\u001b[39m final_df\u001b[38;5;241m.\u001b[39mrename(\n\u001b[1;32m 5\u001b[0m columns\u001b[38;5;241m=\u001b[39m{\n\u001b[1;32m 6\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCountyName\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCounty\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 11\u001b[0m }\n\u001b[1;32m 12\u001b[0m )\n",
|
433 |
+
"\u001b[0;31mNameError\u001b[0m: name 'combined_df' is not defined"
|
434 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
435 |
}
|
436 |
],
|
437 |
"source": [
|
|
|
443 |
" \"CountyName\": \"County\",\n",
|
444 |
" \"BaseDate\": \"Date\",\n",
|
445 |
" \"RegionName\": \"Region\",\n",
|
446 |
+
" \"RegionType\": \"Region Type\",\n",
|
447 |
" \"RegionID\": \"Region ID\",\n",
|
448 |
" \"SizeRank\": \"Size Rank\",\n",
|
449 |
" }\n",
|
|
|
451 |
"\n",
|
452 |
"# iterate over rows of final_df and populate State and City columns if the regionType is msa\n",
|
453 |
"for index, row in final_df.iterrows():\n",
|
454 |
+
" if row[\"Region Type\"] == \"msa\":\n",
|
455 |
" regionName = row[\"Region\"]\n",
|
456 |
" # final_df.at[index, 'Metro'] = regionName\n",
|
457 |
"\n",
|
processors/{home_value_forecasts.py → home_values_forecasts.py}
RENAMED
@@ -69,6 +69,7 @@ final_df = final_df.rename(
|
|
69 |
"CountyName": "County",
|
70 |
"BaseDate": "Date",
|
71 |
"RegionName": "Region",
|
|
|
72 |
"RegionID": "Region ID",
|
73 |
"SizeRank": "Size Rank",
|
74 |
}
|
@@ -76,7 +77,7 @@ final_df = final_df.rename(
|
|
76 |
|
77 |
# iterate over rows of final_df and populate State and City columns if the regionType is msa
|
78 |
for index, row in final_df.iterrows():
|
79 |
-
if row["
|
80 |
regionName = row["Region"]
|
81 |
# final_df.at[index, 'Metro'] = regionName
|
82 |
|
|
|
69 |
"CountyName": "County",
|
70 |
"BaseDate": "Date",
|
71 |
"RegionName": "Region",
|
72 |
+
"RegionType": "Region Type",
|
73 |
"RegionID": "Region ID",
|
74 |
"SizeRank": "Size Rank",
|
75 |
}
|
|
|
77 |
|
78 |
# iterate over rows of final_df and populate State and City columns if the regionType is msa
|
79 |
for index, row in final_df.iterrows():
|
80 |
+
if row["Region Type"] == "msa":
|
81 |
regionName = row["Region"]
|
82 |
# final_df.at[index, 'Metro'] = regionName
|
83 |
|
zillow.py
CHANGED
@@ -88,7 +88,9 @@ class Zillow(datasets.GeneratorBasedBuilder):
|
|
88 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
89 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
90 |
"Region": datasets.Value(dtype="string", id="Region"),
|
91 |
-
"
|
|
|
|
|
92 |
"State": datasets.Value(dtype="string", id="State"),
|
93 |
"City": datasets.Value(dtype="string", id="City"),
|
94 |
"Metro": datasets.Value(dtype="string", id="Metro"),
|
@@ -123,9 +125,13 @@ class Zillow(datasets.GeneratorBasedBuilder):
|
|
123 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
124 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
125 |
"Region": datasets.Value(dtype="string", id="Region"),
|
126 |
-
"Region Type": datasets.
|
|
|
|
|
127 |
"State": datasets.Value(dtype="string", id="State"),
|
128 |
-
"Home Type": datasets.
|
|
|
|
|
129 |
"Date": datasets.Value(dtype="string", id="Date"),
|
130 |
"Median Sale Price": datasets.Value(
|
131 |
dtype="float32", id="Median Sale Price"
|
@@ -142,9 +148,13 @@ class Zillow(datasets.GeneratorBasedBuilder):
|
|
142 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
143 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
144 |
"Region": datasets.Value(dtype="string", id="Region"),
|
145 |
-
"Region Type": datasets.
|
|
|
|
|
146 |
"State": datasets.Value(dtype="string", id="State"),
|
147 |
-
"Home Type": datasets.
|
|
|
|
|
148 |
"Date": datasets.Value(dtype="string", id="Date"),
|
149 |
"Median Listing Price": datasets.Value(
|
150 |
dtype="float32", id="Median Listing Price"
|
@@ -168,9 +178,14 @@ class Zillow(datasets.GeneratorBasedBuilder):
|
|
168 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
169 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
170 |
"Region": datasets.Value(dtype="string", id="Region"),
|
171 |
-
"Region Type": datasets.
|
|
|
|
|
172 |
"State": datasets.Value(dtype="string", id="State"),
|
173 |
-
"Home Type": datasets.
|
|
|
|
|
|
|
174 |
"Date": datasets.Value(dtype="string", id="Date"),
|
175 |
"Rent (Smoothed)": datasets.Value(
|
176 |
dtype="float32", id="Rent (Smoothed)"
|
@@ -186,9 +201,14 @@ class Zillow(datasets.GeneratorBasedBuilder):
|
|
186 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
187 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
188 |
"Region": datasets.Value(dtype="string", id="Region"),
|
189 |
-
"Region Type": datasets.
|
|
|
|
|
190 |
"State": datasets.Value(dtype="string", id="State"),
|
191 |
-
"Home Type": datasets.
|
|
|
|
|
|
|
192 |
"Date": datasets.Value(dtype="string", id="Date"),
|
193 |
"Mean Sale to List Ratio (Smoothed)": datasets.Value(
|
194 |
dtype="float32", id="Mean Sale to List Ratio (Smoothed)"
|
@@ -232,9 +252,22 @@ class Zillow(datasets.GeneratorBasedBuilder):
|
|
232 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
233 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
234 |
"Region": datasets.Value(dtype="string", id="Region"),
|
235 |
-
"Region Type": datasets.
|
236 |
"State": datasets.Value(dtype="string", id="State"),
|
237 |
-
"Home Type": datasets.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
"Date": datasets.Value(dtype="string", id="Date"),
|
239 |
"Bottom Tier ZHVI (Smoothed) (Seasonally Adjusted)": datasets.Value(
|
240 |
dtype="float32",
|
@@ -261,7 +294,10 @@ class Zillow(datasets.GeneratorBasedBuilder):
|
|
261 |
num_classes=2, names=["country", "msa"]
|
262 |
),
|
263 |
"State": datasets.Value(dtype="string", id="State"),
|
264 |
-
"Home Type": datasets.Value(dtype="string", id="Home Type"),
|
|
|
|
|
|
|
265 |
"Date": datasets.Value(dtype="string", id="Date"),
|
266 |
"Mean Listings Price Cut Amount (Smoothed)": datasets.Value(
|
267 |
dtype="float32", id="Mean Listings Price Cut Amount (Smoothed)"
|
@@ -342,7 +378,7 @@ class Zillow(datasets.GeneratorBasedBuilder):
|
|
342 |
"Region ID": data["Region ID"],
|
343 |
"Size Rank": data["Size Rank"],
|
344 |
"Region": data["Region"],
|
345 |
-
"
|
346 |
"State": data["State"],
|
347 |
"City": data["City"],
|
348 |
"Metro": data["Metro"],
|
@@ -449,6 +485,7 @@ class Zillow(datasets.GeneratorBasedBuilder):
|
|
449 |
"Region Type": data["Region Type"],
|
450 |
"State": data["State"],
|
451 |
"Home Type": data["Home Type"],
|
|
|
452 |
"Date": data["Date"],
|
453 |
"Bottom Tier ZHVI (Smoothed) (Seasonally Adjusted)": data[
|
454 |
"Bottom Tier ZHVI (Smoothed) (Seasonally Adjusted)"
|
|
|
88 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
89 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
90 |
"Region": datasets.Value(dtype="string", id="Region"),
|
91 |
+
"Region Type": datasets.ClassLabel(
|
92 |
+
num_classes=3, names=["zip", "country", "msa"]
|
93 |
+
),
|
94 |
"State": datasets.Value(dtype="string", id="State"),
|
95 |
"City": datasets.Value(dtype="string", id="City"),
|
96 |
"Metro": datasets.Value(dtype="string", id="Metro"),
|
|
|
125 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
126 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
127 |
"Region": datasets.Value(dtype="string", id="Region"),
|
128 |
+
"Region Type": datasets.ClassLabel(
|
129 |
+
num_classes=2, names=["country", "msa"]
|
130 |
+
),
|
131 |
"State": datasets.Value(dtype="string", id="State"),
|
132 |
+
"Home Type": datasets.ClassLabel(
|
133 |
+
num_classes=3, names=["SFR", "all homes", "condo/co-op only"]
|
134 |
+
),
|
135 |
"Date": datasets.Value(dtype="string", id="Date"),
|
136 |
"Median Sale Price": datasets.Value(
|
137 |
dtype="float32", id="Median Sale Price"
|
|
|
148 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
149 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
150 |
"Region": datasets.Value(dtype="string", id="Region"),
|
151 |
+
"Region Type": datasets.ClassLabel(
|
152 |
+
num_classes=2, names=["country", "msa"]
|
153 |
+
),
|
154 |
"State": datasets.Value(dtype="string", id="State"),
|
155 |
+
"Home Type": datasets.ClassLabel(
|
156 |
+
num_classes=2, names=["SFR", "all homes"]
|
157 |
+
),
|
158 |
"Date": datasets.Value(dtype="string", id="Date"),
|
159 |
"Median Listing Price": datasets.Value(
|
160 |
dtype="float32", id="Median Listing Price"
|
|
|
178 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
179 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
180 |
"Region": datasets.Value(dtype="string", id="Region"),
|
181 |
+
"Region Type": datasets.ClassLabel(
|
182 |
+
num_classes=5, names=["county", "city", "zip", "country", "msa"]
|
183 |
+
),
|
184 |
"State": datasets.Value(dtype="string", id="State"),
|
185 |
+
"Home Type": datasets.ClassLabel(
|
186 |
+
num_classes=3,
|
187 |
+
names=["all homes plus multifamily", "SFR", "multifamily"],
|
188 |
+
),
|
189 |
"Date": datasets.Value(dtype="string", id="Date"),
|
190 |
"Rent (Smoothed)": datasets.Value(
|
191 |
dtype="float32", id="Rent (Smoothed)"
|
|
|
201 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
202 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
203 |
"Region": datasets.Value(dtype="string", id="Region"),
|
204 |
+
"Region Type": datasets.ClassLabel(
|
205 |
+
num_classes=2, names=["country", "msa"]
|
206 |
+
),
|
207 |
"State": datasets.Value(dtype="string", id="State"),
|
208 |
+
"Home Type": datasets.ClassLabel(
|
209 |
+
num_classes=2,
|
210 |
+
names=["SFR", "all homes"],
|
211 |
+
),
|
212 |
"Date": datasets.Value(dtype="string", id="Date"),
|
213 |
"Mean Sale to List Ratio (Smoothed)": datasets.Value(
|
214 |
dtype="float32", id="Mean Sale to List Ratio (Smoothed)"
|
|
|
252 |
"Region ID": datasets.Value(dtype="string", id="Region ID"),
|
253 |
"Size Rank": datasets.Value(dtype="int32", id="Size Rank"),
|
254 |
"Region": datasets.Value(dtype="string", id="Region"),
|
255 |
+
"Region Type": datasets.ClassLabel(num_classes=1, names=["state"]),
|
256 |
"State": datasets.Value(dtype="string", id="State"),
|
257 |
+
"Home Type": datasets.ClassLabel(
|
258 |
+
num_classes=3, names=["all homes (SFR/condo)", "SFR", "condo"]
|
259 |
+
),
|
260 |
+
"Bedroom Count": datasets.ClassLabel(
|
261 |
+
num_classes=6,
|
262 |
+
names=[
|
263 |
+
"1-Bedroom",
|
264 |
+
"2-Bedrooms",
|
265 |
+
"3-Bedrooms",
|
266 |
+
"4-Bedrooms",
|
267 |
+
"5+-Bedrooms",
|
268 |
+
"All Bedrooms",
|
269 |
+
],
|
270 |
+
),
|
271 |
"Date": datasets.Value(dtype="string", id="Date"),
|
272 |
"Bottom Tier ZHVI (Smoothed) (Seasonally Adjusted)": datasets.Value(
|
273 |
dtype="float32",
|
|
|
294 |
num_classes=2, names=["country", "msa"]
|
295 |
),
|
296 |
"State": datasets.Value(dtype="string", id="State"),
|
297 |
+
# "Home Type": datasets.Value(dtype="string", id="Home Type"),
|
298 |
+
"Home Type": datasets.ClassLabel(
|
299 |
+
num_classes=2, names=["SFR", "all homes (SFR + Condo)"]
|
300 |
+
),
|
301 |
"Date": datasets.Value(dtype="string", id="Date"),
|
302 |
"Mean Listings Price Cut Amount (Smoothed)": datasets.Value(
|
303 |
dtype="float32", id="Mean Listings Price Cut Amount (Smoothed)"
|
|
|
378 |
"Region ID": data["Region ID"],
|
379 |
"Size Rank": data["Size Rank"],
|
380 |
"Region": data["Region"],
|
381 |
+
"Region Type": data["Region Type"],
|
382 |
"State": data["State"],
|
383 |
"City": data["City"],
|
384 |
"Metro": data["Metro"],
|
|
|
485 |
"Region Type": data["Region Type"],
|
486 |
"State": data["State"],
|
487 |
"Home Type": data["Home Type"],
|
488 |
+
"Bedroom Count": data["Bedroom Count"],
|
489 |
"Date": data["Date"],
|
490 |
"Bottom Tier ZHVI (Smoothed) (Seasonally Adjusted)": data[
|
491 |
"Bottom Tier ZHVI (Smoothed) (Seasonally Adjusted)"
|