fix: incorporate other geographies for rentals
Browse files- processed/rentals/final.jsonl +2 -2
- processors/rentals.ipynb +806 -240
processed/rentals/final.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:f8881aca35bd30388f8ce14417b5f6edc4db01dca1be18e8a7e467fcb4258dac
|
3 |
+
size 413052557
|
processors/rentals.ipynb
CHANGED
@@ -25,7 +25,7 @@
|
|
25 |
},
|
26 |
{
|
27 |
"cell_type": "code",
|
28 |
-
"execution_count":
|
29 |
"metadata": {},
|
30 |
"outputs": [
|
31 |
{
|
@@ -55,71 +55,107 @@
|
|
55 |
" <th>RegionType</th>\n",
|
56 |
" <th>StateName</th>\n",
|
57 |
" <th>Home Type</th>\n",
|
|
|
|
|
|
|
|
|
58 |
" <th>Date</th>\n",
|
59 |
" <th>Rent (Smoothed)</th>\n",
|
|
|
60 |
" <th>Rent (Smoothed) (Seasonally Adjusted)</th>\n",
|
|
|
61 |
" </tr>\n",
|
62 |
" </thead>\n",
|
63 |
" <tbody>\n",
|
64 |
" <tr>\n",
|
65 |
" <th>0</th>\n",
|
66 |
-
" <td>
|
67 |
-
" <td>
|
68 |
-
" <td>
|
69 |
-
" <td>
|
70 |
-
" <td>
|
71 |
-
" <td>
|
|
|
|
|
|
|
|
|
72 |
" <td>2015-01-31</td>\n",
|
73 |
-
" <td>
|
74 |
-
" <td>
|
|
|
|
|
75 |
" </tr>\n",
|
76 |
" <tr>\n",
|
77 |
" <th>1</th>\n",
|
78 |
-
" <td>
|
79 |
-
" <td>
|
80 |
-
" <td>
|
81 |
-
" <td>
|
82 |
-
" <td>
|
83 |
-
" <td>
|
|
|
|
|
|
|
|
|
84 |
" <td>2015-02-28</td>\n",
|
85 |
-
" <td>
|
86 |
-
" <td>
|
|
|
|
|
87 |
" </tr>\n",
|
88 |
" <tr>\n",
|
89 |
" <th>2</th>\n",
|
90 |
-
" <td>
|
91 |
-
" <td>
|
92 |
-
" <td>
|
93 |
-
" <td>
|
94 |
-
" <td>
|
95 |
-
" <td>
|
|
|
|
|
|
|
|
|
96 |
" <td>2015-03-31</td>\n",
|
97 |
-
" <td>
|
98 |
-
" <td>
|
|
|
|
|
99 |
" </tr>\n",
|
100 |
" <tr>\n",
|
101 |
" <th>3</th>\n",
|
102 |
-
" <td>
|
103 |
-
" <td>
|
104 |
-
" <td>
|
105 |
-
" <td>
|
106 |
-
" <td>
|
107 |
-
" <td>
|
|
|
|
|
|
|
|
|
108 |
" <td>2015-04-30</td>\n",
|
109 |
-
" <td>
|
110 |
-
" <td>
|
|
|
|
|
111 |
" </tr>\n",
|
112 |
" <tr>\n",
|
113 |
" <th>4</th>\n",
|
114 |
-
" <td>
|
115 |
-
" <td>
|
116 |
-
" <td>
|
117 |
-
" <td>
|
118 |
-
" <td>
|
119 |
-
" <td>
|
|
|
|
|
|
|
|
|
120 |
" <td>2015-05-31</td>\n",
|
121 |
-
" <td>
|
122 |
-
" <td>
|
|
|
|
|
123 |
" </tr>\n",
|
124 |
" <tr>\n",
|
125 |
" <th>...</th>\n",
|
@@ -132,103 +168,165 @@
|
|
132 |
" <td>...</td>\n",
|
133 |
" <td>...</td>\n",
|
134 |
" <td>...</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
" </tr>\n",
|
136 |
" <tr>\n",
|
137 |
-
" <th>
|
138 |
-
" <td>
|
139 |
-
" <td>
|
140 |
-
" <td>
|
141 |
-
" <td>
|
142 |
-
" <td>
|
143 |
-
" <td>multifamily</td>\n",
|
144 |
-
" <td>
|
145 |
" <td>NaN</td>\n",
|
146 |
" <td>NaN</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
" </tr>\n",
|
148 |
" <tr>\n",
|
149 |
-
" <th>
|
150 |
-
" <td>
|
151 |
-
" <td>
|
152 |
-
" <td>
|
153 |
-
" <td>
|
154 |
-
" <td>
|
155 |
-
" <td>multifamily</td>\n",
|
156 |
-
" <td>
|
|
|
157 |
" <td>NaN</td>\n",
|
158 |
" <td>NaN</td>\n",
|
|
|
|
|
|
|
|
|
|
|
159 |
" </tr>\n",
|
160 |
" <tr>\n",
|
161 |
-
" <th>
|
162 |
-
" <td>
|
163 |
-
" <td>
|
164 |
-
" <td>
|
165 |
-
" <td>
|
166 |
-
" <td>
|
167 |
-
" <td>multifamily</td>\n",
|
168 |
-
" <td>
|
169 |
" <td>NaN</td>\n",
|
170 |
" <td>NaN</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
" </tr>\n",
|
172 |
" <tr>\n",
|
173 |
-
" <th>
|
174 |
-
" <td>
|
175 |
-
" <td>
|
176 |
-
" <td>
|
177 |
-
" <td>
|
178 |
-
" <td>
|
179 |
-
" <td>multifamily</td>\n",
|
|
|
|
|
|
|
|
|
180 |
" <td>2023-11-30</td>\n",
|
181 |
-
" <td>
|
182 |
-
" <td>
|
|
|
|
|
183 |
" </tr>\n",
|
184 |
" <tr>\n",
|
185 |
-
" <th>
|
186 |
-
" <td>
|
187 |
-
" <td>
|
188 |
-
" <td>
|
189 |
-
" <td>
|
190 |
-
" <td>
|
191 |
-
" <td>multifamily</td>\n",
|
|
|
|
|
|
|
|
|
192 |
" <td>2023-12-31</td>\n",
|
193 |
-
" <td>
|
194 |
-
" <td>
|
|
|
|
|
195 |
" </tr>\n",
|
196 |
" </tbody>\n",
|
197 |
"</table>\n",
|
198 |
-
"<p>
|
199 |
"</div>"
|
200 |
],
|
201 |
"text/plain": [
|
202 |
-
"
|
203 |
-
"0
|
204 |
-
"1
|
205 |
-
"2
|
206 |
-
"3
|
207 |
-
"4
|
208 |
-
"...
|
209 |
-
"
|
210 |
-
"
|
211 |
-
"
|
212 |
-
"
|
213 |
-
"
|
214 |
"\n",
|
215 |
-
"
|
216 |
-
"0
|
217 |
-
"1
|
218 |
-
"2
|
219 |
-
"3
|
220 |
-
"4
|
221 |
-
"...
|
222 |
-
"
|
223 |
-
"
|
224 |
-
"
|
225 |
-
"
|
226 |
-
"
|
227 |
"\n",
|
228 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
]
|
230 |
},
|
231 |
-
"execution_count":
|
232 |
"metadata": {},
|
233 |
"output_type": "execute_result"
|
234 |
}
|
@@ -236,14 +334,6 @@
|
|
236 |
"source": [
|
237 |
"# base cols RegionID,SizeRank,RegionName,RegionType,StateName\n",
|
238 |
"\n",
|
239 |
-
"exclude_columns = [\n",
|
240 |
-
" \"RegionID\",\n",
|
241 |
-
" \"SizeRank\",\n",
|
242 |
-
" \"RegionName\",\n",
|
243 |
-
" \"RegionType\",\n",
|
244 |
-
" \"StateName\",\n",
|
245 |
-
" \"Home Type\",\n",
|
246 |
-
"]\n",
|
247 |
"\n",
|
248 |
"data_frames = []\n",
|
249 |
"\n",
|
@@ -251,11 +341,63 @@
|
|
251 |
" if filename.endswith(\".csv\"):\n",
|
252 |
" # print(\"processing \" + filename)\n",
|
253 |
" cur_df = pd.read_csv(os.path.join(FULL_DATA_DIR_PATH, filename))\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
"\n",
|
255 |
" if \"_sfrcondomfr_\" in filename:\n",
|
256 |
" cur_df[\"Home Type\"] = \"all homes plus multifamily\"\n",
|
257 |
" # skip for now\n",
|
258 |
-
" continue\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
" elif \"_sfr_\" in filename:\n",
|
260 |
" cur_df[\"Home Type\"] = \"SFR\"\n",
|
261 |
" elif \"_mfr_\" in filename:\n",
|
@@ -267,7 +409,6 @@
|
|
267 |
" smoothed = \"_sm_\" in filename\n",
|
268 |
" seasonally_adjusted = \"_sa_\" in filename\n",
|
269 |
"\n",
|
270 |
-
" # if \"_mlp_\" in filename:\n",
|
271 |
" col_name = \"Rent\"\n",
|
272 |
" if smoothed:\n",
|
273 |
" col_name += \" (Smoothed)\"\n",
|
@@ -334,7 +475,347 @@
|
|
334 |
},
|
335 |
{
|
336 |
"cell_type": "code",
|
337 |
-
"execution_count":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
"metadata": {},
|
339 |
"outputs": [
|
340 |
{
|
@@ -362,73 +843,103 @@
|
|
362 |
" <th>Size Rank</th>\n",
|
363 |
" <th>Region</th>\n",
|
364 |
" <th>Region Type</th>\n",
|
365 |
-
" <th>State</th>\n",
|
366 |
" <th>Home Type</th>\n",
|
|
|
|
|
|
|
|
|
367 |
" <th>Date</th>\n",
|
368 |
" <th>Rent (Smoothed)</th>\n",
|
369 |
" <th>Rent (Smoothed) (Seasonally Adjusted)</th>\n",
|
|
|
|
|
370 |
" </tr>\n",
|
371 |
" </thead>\n",
|
372 |
" <tbody>\n",
|
373 |
" <tr>\n",
|
374 |
" <th>0</th>\n",
|
375 |
-
" <td>
|
376 |
-
" <td>
|
377 |
-
" <td>
|
378 |
-
" <td>
|
379 |
-
" <td>
|
380 |
-
" <td>
|
|
|
|
|
|
|
381 |
" <td>2015-01-31</td>\n",
|
382 |
-
" <td>
|
383 |
-
" <td>
|
|
|
|
|
384 |
" </tr>\n",
|
385 |
" <tr>\n",
|
386 |
-
" <th>
|
387 |
-
" <td>
|
388 |
-
" <td>
|
389 |
-
" <td>
|
390 |
-
" <td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
" <td>NaN</td>\n",
|
392 |
-
" <td>
|
393 |
-
" <td>2015-01-31</td>\n",
|
394 |
-
" <td>1230.637976</td>\n",
|
395 |
-
" <td>1230.637976</td>\n",
|
396 |
" </tr>\n",
|
397 |
" <tr>\n",
|
398 |
-
" <th>
|
399 |
-
" <td>
|
400 |
-
" <td>
|
401 |
-
" <td>
|
402 |
-
" <td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
" <td>NaN</td>\n",
|
404 |
-
" <td>
|
405 |
-
" <td>2015-02-28</td>\n",
|
406 |
-
" <td>1257.678915</td>\n",
|
407 |
-
" <td>1258.745304</td>\n",
|
408 |
" </tr>\n",
|
409 |
" <tr>\n",
|
410 |
-
" <th>
|
411 |
-
" <td>
|
412 |
-
" <td>
|
413 |
-
" <td>
|
414 |
-
" <td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
" <td>NaN</td>\n",
|
416 |
-
" <td>
|
417 |
-
" <td>2015-02-28</td>\n",
|
418 |
-
" <td>1236.170604</td>\n",
|
419 |
-
" <td>1236.170604</td>\n",
|
420 |
" </tr>\n",
|
421 |
" <tr>\n",
|
422 |
-
" <th>
|
423 |
-
" <td>
|
424 |
-
" <td>
|
425 |
-
" <td>
|
426 |
-
" <td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
" <td>NaN</td>\n",
|
428 |
-
" <td>
|
429 |
-
" <td>2015-03-31</td>\n",
|
430 |
-
" <td>1266.242657</td>\n",
|
431 |
-
" <td>1263.914519</td>\n",
|
432 |
" </tr>\n",
|
433 |
" <tr>\n",
|
434 |
" <th>...</th>\n",
|
@@ -441,126 +952,181 @@
|
|
441 |
" <td>...</td>\n",
|
442 |
" <td>...</td>\n",
|
443 |
" <td>...</td>\n",
|
|
|
|
|
|
|
|
|
|
|
444 |
" </tr>\n",
|
445 |
" <tr>\n",
|
446 |
-
" <th>
|
447 |
-
" <td>
|
448 |
-
" <td>
|
449 |
-
" <td>
|
450 |
-
" <td>
|
451 |
-
" <td>
|
452 |
-
" <td>
|
453 |
-
" <td>
|
|
|
454 |
" <td>NaN</td>\n",
|
|
|
|
|
|
|
|
|
455 |
" <td>NaN</td>\n",
|
456 |
" </tr>\n",
|
457 |
" <tr>\n",
|
458 |
-
" <th>
|
459 |
-
" <td>
|
460 |
-
" <td>
|
461 |
-
" <td>
|
462 |
-
" <td>
|
463 |
-
" <td>
|
464 |
-
" <td>
|
465 |
-
" <td>2023-09-30</td>\n",
|
466 |
" <td>NaN</td>\n",
|
467 |
" <td>NaN</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
" </tr>\n",
|
469 |
" <tr>\n",
|
470 |
-
" <th>
|
471 |
-
" <td>
|
472 |
-
" <td>
|
473 |
-
" <td>
|
474 |
-
" <td>
|
475 |
-
" <td>
|
476 |
-
" <td>
|
477 |
-
" <td>
|
|
|
478 |
" <td>NaN</td>\n",
|
|
|
|
|
|
|
|
|
479 |
" <td>NaN</td>\n",
|
480 |
" </tr>\n",
|
481 |
" <tr>\n",
|
482 |
-
" <th>
|
483 |
-
" <td>
|
484 |
-
" <td>
|
485 |
-
" <td>
|
486 |
-
" <td>
|
487 |
-
" <td>
|
488 |
-
" <td>
|
|
|
|
|
|
|
489 |
" <td>2023-11-30</td>\n",
|
490 |
-
" <td>
|
491 |
-
" <td>
|
|
|
|
|
492 |
" </tr>\n",
|
493 |
" <tr>\n",
|
494 |
-
" <th>
|
495 |
-
" <td>
|
496 |
-
" <td>
|
497 |
-
" <td>
|
498 |
-
" <td>
|
499 |
-
" <td>
|
500 |
-
" <td>
|
|
|
|
|
|
|
501 |
" <td>2023-12-31</td>\n",
|
502 |
-
" <td>
|
503 |
-
" <td>
|
|
|
|
|
504 |
" </tr>\n",
|
505 |
" </tbody>\n",
|
506 |
"</table>\n",
|
507 |
-
"<p>
|
508 |
"</div>"
|
509 |
],
|
510 |
"text/plain": [
|
511 |
-
"
|
512 |
-
"0
|
513 |
-
"
|
514 |
-
"
|
515 |
-
"
|
516 |
-
"
|
517 |
-
"...
|
518 |
-
"
|
519 |
-
"
|
520 |
-
"
|
521 |
-
"
|
522 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
"\n",
|
524 |
-
"
|
525 |
-
"0
|
526 |
-
"
|
527 |
-
"1
|
528 |
-
"
|
529 |
-
"
|
530 |
-
"...
|
531 |
-
"
|
532 |
-
"
|
533 |
-
"
|
534 |
-
"
|
535 |
-
"
|
536 |
"\n",
|
537 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
538 |
]
|
539 |
},
|
540 |
-
"execution_count":
|
541 |
"metadata": {},
|
542 |
"output_type": "execute_result"
|
543 |
}
|
544 |
],
|
545 |
"source": [
|
546 |
-
"final_df = combined_df\n",
|
547 |
"final_df = final_df.rename(\n",
|
548 |
" columns={\n",
|
549 |
" \"RegionID\": \"Region ID\",\n",
|
550 |
" \"SizeRank\": \"Size Rank\",\n",
|
551 |
" \"RegionName\": \"Region\",\n",
|
552 |
" \"RegionType\": \"Region Type\",\n",
|
553 |
-
" \"
|
|
|
554 |
" }\n",
|
555 |
")\n",
|
556 |
"\n",
|
557 |
-
"
|
558 |
-
"final_df.sort_values(by=[\"Region ID\", \"Date\", \"Home Type\"])"
|
559 |
]
|
560 |
},
|
561 |
{
|
562 |
"cell_type": "code",
|
563 |
-
"execution_count":
|
564 |
"metadata": {},
|
565 |
"outputs": [],
|
566 |
"source": [
|
|
|
25 |
},
|
26 |
{
|
27 |
"cell_type": "code",
|
28 |
+
"execution_count": 26,
|
29 |
"metadata": {},
|
30 |
"outputs": [
|
31 |
{
|
|
|
55 |
" <th>RegionType</th>\n",
|
56 |
" <th>StateName</th>\n",
|
57 |
" <th>Home Type</th>\n",
|
58 |
+
" <th>State</th>\n",
|
59 |
+
" <th>Metro</th>\n",
|
60 |
+
" <th>StateCodeFIPS</th>\n",
|
61 |
+
" <th>MunicipalCodeFIPS</th>\n",
|
62 |
" <th>Date</th>\n",
|
63 |
" <th>Rent (Smoothed)</th>\n",
|
64 |
+
" <th>CountyName</th>\n",
|
65 |
" <th>Rent (Smoothed) (Seasonally Adjusted)</th>\n",
|
66 |
+
" <th>City</th>\n",
|
67 |
" </tr>\n",
|
68 |
" </thead>\n",
|
69 |
" <tbody>\n",
|
70 |
" <tr>\n",
|
71 |
" <th>0</th>\n",
|
72 |
+
" <td>66</td>\n",
|
73 |
+
" <td>146</td>\n",
|
74 |
+
" <td>Ada County</td>\n",
|
75 |
+
" <td>county</td>\n",
|
76 |
+
" <td>ID</td>\n",
|
77 |
+
" <td>all homes plus multifamily</td>\n",
|
78 |
+
" <td>ID</td>\n",
|
79 |
+
" <td>Boise City, ID</td>\n",
|
80 |
+
" <td>16.0</td>\n",
|
81 |
+
" <td>1.0</td>\n",
|
82 |
" <td>2015-01-31</td>\n",
|
83 |
+
" <td>927.493763</td>\n",
|
84 |
+
" <td>NaN</td>\n",
|
85 |
+
" <td>927.493763</td>\n",
|
86 |
+
" <td>NaN</td>\n",
|
87 |
" </tr>\n",
|
88 |
" <tr>\n",
|
89 |
" <th>1</th>\n",
|
90 |
+
" <td>66</td>\n",
|
91 |
+
" <td>146</td>\n",
|
92 |
+
" <td>Ada County</td>\n",
|
93 |
+
" <td>county</td>\n",
|
94 |
+
" <td>ID</td>\n",
|
95 |
+
" <td>all homes plus multifamily</td>\n",
|
96 |
+
" <td>ID</td>\n",
|
97 |
+
" <td>Boise City, ID</td>\n",
|
98 |
+
" <td>16.0</td>\n",
|
99 |
+
" <td>1.0</td>\n",
|
100 |
" <td>2015-02-28</td>\n",
|
101 |
+
" <td>931.690623</td>\n",
|
102 |
+
" <td>NaN</td>\n",
|
103 |
+
" <td>931.690623</td>\n",
|
104 |
+
" <td>NaN</td>\n",
|
105 |
" </tr>\n",
|
106 |
" <tr>\n",
|
107 |
" <th>2</th>\n",
|
108 |
+
" <td>66</td>\n",
|
109 |
+
" <td>146</td>\n",
|
110 |
+
" <td>Ada County</td>\n",
|
111 |
+
" <td>county</td>\n",
|
112 |
+
" <td>ID</td>\n",
|
113 |
+
" <td>all homes plus multifamily</td>\n",
|
114 |
+
" <td>ID</td>\n",
|
115 |
+
" <td>Boise City, ID</td>\n",
|
116 |
+
" <td>16.0</td>\n",
|
117 |
+
" <td>1.0</td>\n",
|
118 |
" <td>2015-03-31</td>\n",
|
119 |
+
" <td>932.568601</td>\n",
|
120 |
+
" <td>NaN</td>\n",
|
121 |
+
" <td>932.568601</td>\n",
|
122 |
+
" <td>NaN</td>\n",
|
123 |
" </tr>\n",
|
124 |
" <tr>\n",
|
125 |
" <th>3</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>ID</td>\n",
|
131 |
+
" <td>all homes plus multifamily</td>\n",
|
132 |
+
" <td>ID</td>\n",
|
133 |
+
" <td>Boise City, ID</td>\n",
|
134 |
+
" <td>16.0</td>\n",
|
135 |
+
" <td>1.0</td>\n",
|
136 |
" <td>2015-04-30</td>\n",
|
137 |
+
" <td>933.148134</td>\n",
|
138 |
+
" <td>NaN</td>\n",
|
139 |
+
" <td>933.148134</td>\n",
|
140 |
+
" <td>NaN</td>\n",
|
141 |
" </tr>\n",
|
142 |
" <tr>\n",
|
143 |
" <th>4</th>\n",
|
144 |
+
" <td>66</td>\n",
|
145 |
+
" <td>146</td>\n",
|
146 |
+
" <td>Ada County</td>\n",
|
147 |
+
" <td>county</td>\n",
|
148 |
+
" <td>ID</td>\n",
|
149 |
+
" <td>all homes plus multifamily</td>\n",
|
150 |
+
" <td>ID</td>\n",
|
151 |
+
" <td>Boise City, ID</td>\n",
|
152 |
+
" <td>16.0</td>\n",
|
153 |
+
" <td>1.0</td>\n",
|
154 |
" <td>2015-05-31</td>\n",
|
155 |
+
" <td>941.045724</td>\n",
|
156 |
+
" <td>NaN</td>\n",
|
157 |
+
" <td>941.045724</td>\n",
|
158 |
+
" <td>NaN</td>\n",
|
159 |
" </tr>\n",
|
160 |
" <tr>\n",
|
161 |
" <th>...</th>\n",
|
|
|
168 |
" <td>...</td>\n",
|
169 |
" <td>...</td>\n",
|
170 |
" <td>...</td>\n",
|
171 |
+
" <td>...</td>\n",
|
172 |
+
" <td>...</td>\n",
|
173 |
+
" <td>...</td>\n",
|
174 |
+
" <td>...</td>\n",
|
175 |
+
" <td>...</td>\n",
|
176 |
+
" <td>...</td>\n",
|
177 |
" </tr>\n",
|
178 |
" <tr>\n",
|
179 |
+
" <th>1258735</th>\n",
|
180 |
+
" <td>857850</td>\n",
|
181 |
+
" <td>713</td>\n",
|
182 |
+
" <td>Cherry Hill</td>\n",
|
183 |
+
" <td>city</td>\n",
|
184 |
+
" <td>NJ</td>\n",
|
185 |
+
" <td>all homes plus multifamily</td>\n",
|
186 |
+
" <td>NaN</td>\n",
|
187 |
" <td>NaN</td>\n",
|
188 |
" <td>NaN</td>\n",
|
189 |
+
" <td>NaN</td>\n",
|
190 |
+
" <td>2023-08-31</td>\n",
|
191 |
+
" <td>2291.604800</td>\n",
|
192 |
+
" <td>Camden County</td>\n",
|
193 |
+
" <td>2244.961006</td>\n",
|
194 |
+
" <td>NaN</td>\n",
|
195 |
" </tr>\n",
|
196 |
" <tr>\n",
|
197 |
+
" <th>1258736</th>\n",
|
198 |
+
" <td>857850</td>\n",
|
199 |
+
" <td>713</td>\n",
|
200 |
+
" <td>Cherry Hill</td>\n",
|
201 |
+
" <td>city</td>\n",
|
202 |
+
" <td>NJ</td>\n",
|
203 |
+
" <td>all homes plus multifamily</td>\n",
|
204 |
+
" <td>NaN</td>\n",
|
205 |
+
" <td>NaN</td>\n",
|
206 |
" <td>NaN</td>\n",
|
207 |
" <td>NaN</td>\n",
|
208 |
+
" <td>2023-09-30</td>\n",
|
209 |
+
" <td>2296.188906</td>\n",
|
210 |
+
" <td>Camden County</td>\n",
|
211 |
+
" <td>2254.213172</td>\n",
|
212 |
+
" <td>NaN</td>\n",
|
213 |
" </tr>\n",
|
214 |
" <tr>\n",
|
215 |
+
" <th>1258737</th>\n",
|
216 |
+
" <td>857850</td>\n",
|
217 |
+
" <td>713</td>\n",
|
218 |
+
" <td>Cherry Hill</td>\n",
|
219 |
+
" <td>city</td>\n",
|
220 |
+
" <td>NJ</td>\n",
|
221 |
+
" <td>all homes plus multifamily</td>\n",
|
222 |
+
" <td>NaN</td>\n",
|
223 |
" <td>NaN</td>\n",
|
224 |
" <td>NaN</td>\n",
|
225 |
+
" <td>NaN</td>\n",
|
226 |
+
" <td>2023-10-31</td>\n",
|
227 |
+
" <td>2292.270938</td>\n",
|
228 |
+
" <td>Camden County</td>\n",
|
229 |
+
" <td>2261.540446</td>\n",
|
230 |
+
" <td>NaN</td>\n",
|
231 |
" </tr>\n",
|
232 |
" <tr>\n",
|
233 |
+
" <th>1258738</th>\n",
|
234 |
+
" <td>857850</td>\n",
|
235 |
+
" <td>713</td>\n",
|
236 |
+
" <td>Cherry Hill</td>\n",
|
237 |
+
" <td>city</td>\n",
|
238 |
+
" <td>NJ</td>\n",
|
239 |
+
" <td>all homes plus multifamily</td>\n",
|
240 |
+
" <td>NaN</td>\n",
|
241 |
+
" <td>NaN</td>\n",
|
242 |
+
" <td>NaN</td>\n",
|
243 |
+
" <td>NaN</td>\n",
|
244 |
" <td>2023-11-30</td>\n",
|
245 |
+
" <td>2253.417140</td>\n",
|
246 |
+
" <td>Camden County</td>\n",
|
247 |
+
" <td>2257.956024</td>\n",
|
248 |
+
" <td>NaN</td>\n",
|
249 |
" </tr>\n",
|
250 |
" <tr>\n",
|
251 |
+
" <th>1258739</th>\n",
|
252 |
+
" <td>857850</td>\n",
|
253 |
+
" <td>713</td>\n",
|
254 |
+
" <td>Cherry Hill</td>\n",
|
255 |
+
" <td>city</td>\n",
|
256 |
+
" <td>NJ</td>\n",
|
257 |
+
" <td>all homes plus multifamily</td>\n",
|
258 |
+
" <td>NaN</td>\n",
|
259 |
+
" <td>NaN</td>\n",
|
260 |
+
" <td>NaN</td>\n",
|
261 |
+
" <td>NaN</td>\n",
|
262 |
" <td>2023-12-31</td>\n",
|
263 |
+
" <td>2280.830303</td>\n",
|
264 |
+
" <td>Camden County</td>\n",
|
265 |
+
" <td>2280.830303</td>\n",
|
266 |
+
" <td>NaN</td>\n",
|
267 |
" </tr>\n",
|
268 |
" </tbody>\n",
|
269 |
"</table>\n",
|
270 |
+
"<p>1258740 rows × 15 columns</p>\n",
|
271 |
"</div>"
|
272 |
],
|
273 |
"text/plain": [
|
274 |
+
" RegionID SizeRank RegionName RegionType StateName \\\n",
|
275 |
+
"0 66 146 Ada County county ID \n",
|
276 |
+
"1 66 146 Ada County county ID \n",
|
277 |
+
"2 66 146 Ada County county ID \n",
|
278 |
+
"3 66 146 Ada County county ID \n",
|
279 |
+
"4 66 146 Ada County county ID \n",
|
280 |
+
"... ... ... ... ... ... \n",
|
281 |
+
"1258735 857850 713 Cherry Hill city NJ \n",
|
282 |
+
"1258736 857850 713 Cherry Hill city NJ \n",
|
283 |
+
"1258737 857850 713 Cherry Hill city NJ \n",
|
284 |
+
"1258738 857850 713 Cherry Hill city NJ \n",
|
285 |
+
"1258739 857850 713 Cherry Hill city NJ \n",
|
286 |
"\n",
|
287 |
+
" Home Type State Metro StateCodeFIPS \\\n",
|
288 |
+
"0 all homes plus multifamily ID Boise City, ID 16.0 \n",
|
289 |
+
"1 all homes plus multifamily ID Boise City, ID 16.0 \n",
|
290 |
+
"2 all homes plus multifamily ID Boise City, ID 16.0 \n",
|
291 |
+
"3 all homes plus multifamily ID Boise City, ID 16.0 \n",
|
292 |
+
"4 all homes plus multifamily ID Boise City, ID 16.0 \n",
|
293 |
+
"... ... ... ... ... \n",
|
294 |
+
"1258735 all homes plus multifamily NaN NaN NaN \n",
|
295 |
+
"1258736 all homes plus multifamily NaN NaN NaN \n",
|
296 |
+
"1258737 all homes plus multifamily NaN NaN NaN \n",
|
297 |
+
"1258738 all homes plus multifamily NaN NaN NaN \n",
|
298 |
+
"1258739 all homes plus multifamily NaN NaN NaN \n",
|
299 |
"\n",
|
300 |
+
" MunicipalCodeFIPS Date Rent (Smoothed) CountyName \\\n",
|
301 |
+
"0 1.0 2015-01-31 927.493763 NaN \n",
|
302 |
+
"1 1.0 2015-02-28 931.690623 NaN \n",
|
303 |
+
"2 1.0 2015-03-31 932.568601 NaN \n",
|
304 |
+
"3 1.0 2015-04-30 933.148134 NaN \n",
|
305 |
+
"4 1.0 2015-05-31 941.045724 NaN \n",
|
306 |
+
"... ... ... ... ... \n",
|
307 |
+
"1258735 NaN 2023-08-31 2291.604800 Camden County \n",
|
308 |
+
"1258736 NaN 2023-09-30 2296.188906 Camden County \n",
|
309 |
+
"1258737 NaN 2023-10-31 2292.270938 Camden County \n",
|
310 |
+
"1258738 NaN 2023-11-30 2253.417140 Camden County \n",
|
311 |
+
"1258739 NaN 2023-12-31 2280.830303 Camden County \n",
|
312 |
+
"\n",
|
313 |
+
" Rent (Smoothed) (Seasonally Adjusted) City \n",
|
314 |
+
"0 927.493763 NaN \n",
|
315 |
+
"1 931.690623 NaN \n",
|
316 |
+
"2 932.568601 NaN \n",
|
317 |
+
"3 933.148134 NaN \n",
|
318 |
+
"4 941.045724 NaN \n",
|
319 |
+
"... ... ... \n",
|
320 |
+
"1258735 2244.961006 NaN \n",
|
321 |
+
"1258736 2254.213172 NaN \n",
|
322 |
+
"1258737 2261.540446 NaN \n",
|
323 |
+
"1258738 2257.956024 NaN \n",
|
324 |
+
"1258739 2280.830303 NaN \n",
|
325 |
+
"\n",
|
326 |
+
"[1258740 rows x 15 columns]"
|
327 |
]
|
328 |
},
|
329 |
+
"execution_count": 26,
|
330 |
"metadata": {},
|
331 |
"output_type": "execute_result"
|
332 |
}
|
|
|
334 |
"source": [
|
335 |
"# base cols RegionID,SizeRank,RegionName,RegionType,StateName\n",
|
336 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
"\n",
|
338 |
"data_frames = []\n",
|
339 |
"\n",
|
|
|
341 |
" if filename.endswith(\".csv\"):\n",
|
342 |
" # print(\"processing \" + filename)\n",
|
343 |
" cur_df = pd.read_csv(os.path.join(FULL_DATA_DIR_PATH, filename))\n",
|
344 |
+
" exclude_columns = [\n",
|
345 |
+
" \"RegionID\",\n",
|
346 |
+
" \"SizeRank\",\n",
|
347 |
+
" \"RegionName\",\n",
|
348 |
+
" \"RegionType\",\n",
|
349 |
+
" \"StateName\",\n",
|
350 |
+
" \"Home Type\",\n",
|
351 |
+
" ]\n",
|
352 |
"\n",
|
353 |
" if \"_sfrcondomfr_\" in filename:\n",
|
354 |
" cur_df[\"Home Type\"] = \"all homes plus multifamily\"\n",
|
355 |
" # skip for now\n",
|
356 |
+
" # continue\n",
|
357 |
+
" # change column type to string\n",
|
358 |
+
" cur_df[\"RegionName\"] = cur_df[\"RegionName\"].astype(str)\n",
|
359 |
+
" if \"City\" in filename:\n",
|
360 |
+
" exclude_columns = [\n",
|
361 |
+
" \"RegionID\",\n",
|
362 |
+
" \"SizeRank\",\n",
|
363 |
+
" \"RegionName\",\n",
|
364 |
+
" \"RegionType\",\n",
|
365 |
+
" \"StateName\",\n",
|
366 |
+
" \"Home Type\",\n",
|
367 |
+
" # City Specific\n",
|
368 |
+
" \"State\",\n",
|
369 |
+
" \"Metro\",\n",
|
370 |
+
" \"CountyName\",\n",
|
371 |
+
" ]\n",
|
372 |
+
" elif \"Zip\" in filename:\n",
|
373 |
+
" exclude_columns = [\n",
|
374 |
+
" \"RegionID\",\n",
|
375 |
+
" \"SizeRank\",\n",
|
376 |
+
" \"RegionName\",\n",
|
377 |
+
" \"RegionType\",\n",
|
378 |
+
" \"StateName\",\n",
|
379 |
+
" \"Home Type\",\n",
|
380 |
+
" # Zip Specific\n",
|
381 |
+
" \"State\",\n",
|
382 |
+
" \"City\",\n",
|
383 |
+
" \"Metro\",\n",
|
384 |
+
" \"CountyName\",\n",
|
385 |
+
" ]\n",
|
386 |
+
" elif \"County\" in filename:\n",
|
387 |
+
" exclude_columns = [\n",
|
388 |
+
" \"RegionID\",\n",
|
389 |
+
" \"SizeRank\",\n",
|
390 |
+
" \"RegionName\",\n",
|
391 |
+
" \"RegionType\",\n",
|
392 |
+
" \"StateName\",\n",
|
393 |
+
" \"Home Type\",\n",
|
394 |
+
" # County Specific\n",
|
395 |
+
" \"State\",\n",
|
396 |
+
" \"Metro\",\n",
|
397 |
+
" \"StateCodeFIPS\",\n",
|
398 |
+
" \"MunicipalCodeFIPS\",\n",
|
399 |
+
" ]\n",
|
400 |
+
"\n",
|
401 |
" elif \"_sfr_\" in filename:\n",
|
402 |
" cur_df[\"Home Type\"] = \"SFR\"\n",
|
403 |
" elif \"_mfr_\" in filename:\n",
|
|
|
409 |
" smoothed = \"_sm_\" in filename\n",
|
410 |
" seasonally_adjusted = \"_sa_\" in filename\n",
|
411 |
"\n",
|
|
|
412 |
" col_name = \"Rent\"\n",
|
413 |
" if smoothed:\n",
|
414 |
" col_name += \" (Smoothed)\"\n",
|
|
|
475 |
},
|
476 |
{
|
477 |
"cell_type": "code",
|
478 |
+
"execution_count": 27,
|
479 |
+
"metadata": {},
|
480 |
+
"outputs": [
|
481 |
+
{
|
482 |
+
"data": {
|
483 |
+
"text/plain": [
|
484 |
+
"Index(['RegionID', 'SizeRank', 'RegionName', 'RegionType', 'StateName',\n",
|
485 |
+
" 'Home Type', 'State', 'Metro', 'StateCodeFIPS', 'MunicipalCodeFIPS',\n",
|
486 |
+
" 'Date', 'Rent (Smoothed)', 'CountyName',\n",
|
487 |
+
" 'Rent (Smoothed) (Seasonally Adjusted)', 'City'],\n",
|
488 |
+
" dtype='object')"
|
489 |
+
]
|
490 |
+
},
|
491 |
+
"execution_count": 27,
|
492 |
+
"metadata": {},
|
493 |
+
"output_type": "execute_result"
|
494 |
+
}
|
495 |
+
],
|
496 |
+
"source": [
|
497 |
+
"combined_df.columns\n",
|
498 |
+
"# combined_df[\"RegionType\"].unique()\n",
|
499 |
+
"\n",
|
500 |
+
"# combined_df"
|
501 |
+
]
|
502 |
+
},
|
503 |
+
{
|
504 |
+
"cell_type": "code",
|
505 |
+
"execution_count": 32,
|
506 |
+
"metadata": {},
|
507 |
+
"outputs": [
|
508 |
+
{
|
509 |
+
"data": {
|
510 |
+
"text/html": [
|
511 |
+
"<div>\n",
|
512 |
+
"<style scoped>\n",
|
513 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
514 |
+
" vertical-align: middle;\n",
|
515 |
+
" }\n",
|
516 |
+
"\n",
|
517 |
+
" .dataframe tbody tr th {\n",
|
518 |
+
" vertical-align: top;\n",
|
519 |
+
" }\n",
|
520 |
+
"\n",
|
521 |
+
" .dataframe thead th {\n",
|
522 |
+
" text-align: right;\n",
|
523 |
+
" }\n",
|
524 |
+
"</style>\n",
|
525 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
526 |
+
" <thead>\n",
|
527 |
+
" <tr style=\"text-align: right;\">\n",
|
528 |
+
" <th></th>\n",
|
529 |
+
" <th>RegionID</th>\n",
|
530 |
+
" <th>SizeRank</th>\n",
|
531 |
+
" <th>RegionName</th>\n",
|
532 |
+
" <th>RegionType</th>\n",
|
533 |
+
" <th>Home Type</th>\n",
|
534 |
+
" <th>State</th>\n",
|
535 |
+
" <th>Metro</th>\n",
|
536 |
+
" <th>StateCodeFIPS</th>\n",
|
537 |
+
" <th>MunicipalCodeFIPS</th>\n",
|
538 |
+
" <th>Date</th>\n",
|
539 |
+
" <th>Rent (Smoothed)</th>\n",
|
540 |
+
" <th>Rent (Smoothed) (Seasonally Adjusted)</th>\n",
|
541 |
+
" <th>City</th>\n",
|
542 |
+
" <th>County</th>\n",
|
543 |
+
" </tr>\n",
|
544 |
+
" </thead>\n",
|
545 |
+
" <tbody>\n",
|
546 |
+
" <tr>\n",
|
547 |
+
" <th>0</th>\n",
|
548 |
+
" <td>66</td>\n",
|
549 |
+
" <td>146</td>\n",
|
550 |
+
" <td>Ada County</td>\n",
|
551 |
+
" <td>county</td>\n",
|
552 |
+
" <td>all homes plus multifamily</td>\n",
|
553 |
+
" <td>Ada County</td>\n",
|
554 |
+
" <td>Boise City, ID</td>\n",
|
555 |
+
" <td>16.0</td>\n",
|
556 |
+
" <td>1.0</td>\n",
|
557 |
+
" <td>2015-01-31</td>\n",
|
558 |
+
" <td>927.493763</td>\n",
|
559 |
+
" <td>927.493763</td>\n",
|
560 |
+
" <td>NaN</td>\n",
|
561 |
+
" <td>Ada County</td>\n",
|
562 |
+
" </tr>\n",
|
563 |
+
" <tr>\n",
|
564 |
+
" <th>1</th>\n",
|
565 |
+
" <td>66</td>\n",
|
566 |
+
" <td>146</td>\n",
|
567 |
+
" <td>Ada County</td>\n",
|
568 |
+
" <td>county</td>\n",
|
569 |
+
" <td>all homes plus multifamily</td>\n",
|
570 |
+
" <td>Ada County</td>\n",
|
571 |
+
" <td>Boise City, ID</td>\n",
|
572 |
+
" <td>16.0</td>\n",
|
573 |
+
" <td>1.0</td>\n",
|
574 |
+
" <td>2015-02-28</td>\n",
|
575 |
+
" <td>931.690623</td>\n",
|
576 |
+
" <td>931.690623</td>\n",
|
577 |
+
" <td>NaN</td>\n",
|
578 |
+
" <td>Ada County</td>\n",
|
579 |
+
" </tr>\n",
|
580 |
+
" <tr>\n",
|
581 |
+
" <th>2</th>\n",
|
582 |
+
" <td>66</td>\n",
|
583 |
+
" <td>146</td>\n",
|
584 |
+
" <td>Ada County</td>\n",
|
585 |
+
" <td>county</td>\n",
|
586 |
+
" <td>all homes plus multifamily</td>\n",
|
587 |
+
" <td>Ada County</td>\n",
|
588 |
+
" <td>Boise City, ID</td>\n",
|
589 |
+
" <td>16.0</td>\n",
|
590 |
+
" <td>1.0</td>\n",
|
591 |
+
" <td>2015-03-31</td>\n",
|
592 |
+
" <td>932.568601</td>\n",
|
593 |
+
" <td>932.568601</td>\n",
|
594 |
+
" <td>NaN</td>\n",
|
595 |
+
" <td>Ada County</td>\n",
|
596 |
+
" </tr>\n",
|
597 |
+
" <tr>\n",
|
598 |
+
" <th>3</th>\n",
|
599 |
+
" <td>66</td>\n",
|
600 |
+
" <td>146</td>\n",
|
601 |
+
" <td>Ada County</td>\n",
|
602 |
+
" <td>county</td>\n",
|
603 |
+
" <td>all homes plus multifamily</td>\n",
|
604 |
+
" <td>Ada County</td>\n",
|
605 |
+
" <td>Boise City, ID</td>\n",
|
606 |
+
" <td>16.0</td>\n",
|
607 |
+
" <td>1.0</td>\n",
|
608 |
+
" <td>2015-04-30</td>\n",
|
609 |
+
" <td>933.148134</td>\n",
|
610 |
+
" <td>933.148134</td>\n",
|
611 |
+
" <td>NaN</td>\n",
|
612 |
+
" <td>Ada County</td>\n",
|
613 |
+
" </tr>\n",
|
614 |
+
" <tr>\n",
|
615 |
+
" <th>4</th>\n",
|
616 |
+
" <td>66</td>\n",
|
617 |
+
" <td>146</td>\n",
|
618 |
+
" <td>Ada County</td>\n",
|
619 |
+
" <td>county</td>\n",
|
620 |
+
" <td>all homes plus multifamily</td>\n",
|
621 |
+
" <td>Ada County</td>\n",
|
622 |
+
" <td>Boise City, ID</td>\n",
|
623 |
+
" <td>16.0</td>\n",
|
624 |
+
" <td>1.0</td>\n",
|
625 |
+
" <td>2015-05-31</td>\n",
|
626 |
+
" <td>941.045724</td>\n",
|
627 |
+
" <td>941.045724</td>\n",
|
628 |
+
" <td>NaN</td>\n",
|
629 |
+
" <td>Ada County</td>\n",
|
630 |
+
" </tr>\n",
|
631 |
+
" <tr>\n",
|
632 |
+
" <th>...</th>\n",
|
633 |
+
" <td>...</td>\n",
|
634 |
+
" <td>...</td>\n",
|
635 |
+
" <td>...</td>\n",
|
636 |
+
" <td>...</td>\n",
|
637 |
+
" <td>...</td>\n",
|
638 |
+
" <td>...</td>\n",
|
639 |
+
" <td>...</td>\n",
|
640 |
+
" <td>...</td>\n",
|
641 |
+
" <td>...</td>\n",
|
642 |
+
" <td>...</td>\n",
|
643 |
+
" <td>...</td>\n",
|
644 |
+
" <td>...</td>\n",
|
645 |
+
" <td>...</td>\n",
|
646 |
+
" <td>...</td>\n",
|
647 |
+
" </tr>\n",
|
648 |
+
" <tr>\n",
|
649 |
+
" <th>1258735</th>\n",
|
650 |
+
" <td>857850</td>\n",
|
651 |
+
" <td>713</td>\n",
|
652 |
+
" <td>Cherry Hill</td>\n",
|
653 |
+
" <td>city</td>\n",
|
654 |
+
" <td>all homes plus multifamily</td>\n",
|
655 |
+
" <td>Camden County</td>\n",
|
656 |
+
" <td>NaN</td>\n",
|
657 |
+
" <td>NaN</td>\n",
|
658 |
+
" <td>NaN</td>\n",
|
659 |
+
" <td>2023-08-31</td>\n",
|
660 |
+
" <td>2291.604800</td>\n",
|
661 |
+
" <td>2244.961006</td>\n",
|
662 |
+
" <td>Cherry Hill</td>\n",
|
663 |
+
" <td>NaN</td>\n",
|
664 |
+
" </tr>\n",
|
665 |
+
" <tr>\n",
|
666 |
+
" <th>1258736</th>\n",
|
667 |
+
" <td>857850</td>\n",
|
668 |
+
" <td>713</td>\n",
|
669 |
+
" <td>Cherry Hill</td>\n",
|
670 |
+
" <td>city</td>\n",
|
671 |
+
" <td>all homes plus multifamily</td>\n",
|
672 |
+
" <td>Camden County</td>\n",
|
673 |
+
" <td>NaN</td>\n",
|
674 |
+
" <td>NaN</td>\n",
|
675 |
+
" <td>NaN</td>\n",
|
676 |
+
" <td>2023-09-30</td>\n",
|
677 |
+
" <td>2296.188906</td>\n",
|
678 |
+
" <td>2254.213172</td>\n",
|
679 |
+
" <td>Cherry Hill</td>\n",
|
680 |
+
" <td>NaN</td>\n",
|
681 |
+
" </tr>\n",
|
682 |
+
" <tr>\n",
|
683 |
+
" <th>1258737</th>\n",
|
684 |
+
" <td>857850</td>\n",
|
685 |
+
" <td>713</td>\n",
|
686 |
+
" <td>Cherry Hill</td>\n",
|
687 |
+
" <td>city</td>\n",
|
688 |
+
" <td>all homes plus multifamily</td>\n",
|
689 |
+
" <td>Camden County</td>\n",
|
690 |
+
" <td>NaN</td>\n",
|
691 |
+
" <td>NaN</td>\n",
|
692 |
+
" <td>NaN</td>\n",
|
693 |
+
" <td>2023-10-31</td>\n",
|
694 |
+
" <td>2292.270938</td>\n",
|
695 |
+
" <td>2261.540446</td>\n",
|
696 |
+
" <td>Cherry Hill</td>\n",
|
697 |
+
" <td>NaN</td>\n",
|
698 |
+
" </tr>\n",
|
699 |
+
" <tr>\n",
|
700 |
+
" <th>1258738</th>\n",
|
701 |
+
" <td>857850</td>\n",
|
702 |
+
" <td>713</td>\n",
|
703 |
+
" <td>Cherry Hill</td>\n",
|
704 |
+
" <td>city</td>\n",
|
705 |
+
" <td>all homes plus multifamily</td>\n",
|
706 |
+
" <td>Camden County</td>\n",
|
707 |
+
" <td>NaN</td>\n",
|
708 |
+
" <td>NaN</td>\n",
|
709 |
+
" <td>NaN</td>\n",
|
710 |
+
" <td>2023-11-30</td>\n",
|
711 |
+
" <td>2253.417140</td>\n",
|
712 |
+
" <td>2257.956024</td>\n",
|
713 |
+
" <td>Cherry Hill</td>\n",
|
714 |
+
" <td>NaN</td>\n",
|
715 |
+
" </tr>\n",
|
716 |
+
" <tr>\n",
|
717 |
+
" <th>1258739</th>\n",
|
718 |
+
" <td>857850</td>\n",
|
719 |
+
" <td>713</td>\n",
|
720 |
+
" <td>Cherry Hill</td>\n",
|
721 |
+
" <td>city</td>\n",
|
722 |
+
" <td>all homes plus multifamily</td>\n",
|
723 |
+
" <td>Camden County</td>\n",
|
724 |
+
" <td>NaN</td>\n",
|
725 |
+
" <td>NaN</td>\n",
|
726 |
+
" <td>NaN</td>\n",
|
727 |
+
" <td>2023-12-31</td>\n",
|
728 |
+
" <td>2280.830303</td>\n",
|
729 |
+
" <td>2280.830303</td>\n",
|
730 |
+
" <td>Cherry Hill</td>\n",
|
731 |
+
" <td>NaN</td>\n",
|
732 |
+
" </tr>\n",
|
733 |
+
" </tbody>\n",
|
734 |
+
"</table>\n",
|
735 |
+
"<p>1258740 rows × 14 columns</p>\n",
|
736 |
+
"</div>"
|
737 |
+
],
|
738 |
+
"text/plain": [
|
739 |
+
" RegionID SizeRank RegionName RegionType \\\n",
|
740 |
+
"0 66 146 Ada County county \n",
|
741 |
+
"1 66 146 Ada County county \n",
|
742 |
+
"2 66 146 Ada County county \n",
|
743 |
+
"3 66 146 Ada County county \n",
|
744 |
+
"4 66 146 Ada County county \n",
|
745 |
+
"... ... ... ... ... \n",
|
746 |
+
"1258735 857850 713 Cherry Hill city \n",
|
747 |
+
"1258736 857850 713 Cherry Hill city \n",
|
748 |
+
"1258737 857850 713 Cherry Hill city \n",
|
749 |
+
"1258738 857850 713 Cherry Hill city \n",
|
750 |
+
"1258739 857850 713 Cherry Hill city \n",
|
751 |
+
"\n",
|
752 |
+
" Home Type State Metro \\\n",
|
753 |
+
"0 all homes plus multifamily Ada County Boise City, ID \n",
|
754 |
+
"1 all homes plus multifamily Ada County Boise City, ID \n",
|
755 |
+
"2 all homes plus multifamily Ada County Boise City, ID \n",
|
756 |
+
"3 all homes plus multifamily Ada County Boise City, ID \n",
|
757 |
+
"4 all homes plus multifamily Ada County Boise City, ID \n",
|
758 |
+
"... ... ... ... \n",
|
759 |
+
"1258735 all homes plus multifamily Camden County NaN \n",
|
760 |
+
"1258736 all homes plus multifamily Camden County NaN \n",
|
761 |
+
"1258737 all homes plus multifamily Camden County NaN \n",
|
762 |
+
"1258738 all homes plus multifamily Camden County NaN \n",
|
763 |
+
"1258739 all homes plus multifamily Camden County NaN \n",
|
764 |
+
"\n",
|
765 |
+
" StateCodeFIPS MunicipalCodeFIPS Date Rent (Smoothed) \\\n",
|
766 |
+
"0 16.0 1.0 2015-01-31 927.493763 \n",
|
767 |
+
"1 16.0 1.0 2015-02-28 931.690623 \n",
|
768 |
+
"2 16.0 1.0 2015-03-31 932.568601 \n",
|
769 |
+
"3 16.0 1.0 2015-04-30 933.148134 \n",
|
770 |
+
"4 16.0 1.0 2015-05-31 941.045724 \n",
|
771 |
+
"... ... ... ... ... \n",
|
772 |
+
"1258735 NaN NaN 2023-08-31 2291.604800 \n",
|
773 |
+
"1258736 NaN NaN 2023-09-30 2296.188906 \n",
|
774 |
+
"1258737 NaN NaN 2023-10-31 2292.270938 \n",
|
775 |
+
"1258738 NaN NaN 2023-11-30 2253.417140 \n",
|
776 |
+
"1258739 NaN NaN 2023-12-31 2280.830303 \n",
|
777 |
+
"\n",
|
778 |
+
" Rent (Smoothed) (Seasonally Adjusted) City County \n",
|
779 |
+
"0 927.493763 NaN Ada County \n",
|
780 |
+
"1 931.690623 NaN Ada County \n",
|
781 |
+
"2 932.568601 NaN Ada County \n",
|
782 |
+
"3 933.148134 NaN Ada County \n",
|
783 |
+
"4 941.045724 NaN Ada County \n",
|
784 |
+
"... ... ... ... \n",
|
785 |
+
"1258735 2244.961006 Cherry Hill NaN \n",
|
786 |
+
"1258736 2254.213172 Cherry Hill NaN \n",
|
787 |
+
"1258737 2261.540446 Cherry Hill NaN \n",
|
788 |
+
"1258738 2257.956024 Cherry Hill NaN \n",
|
789 |
+
"1258739 2280.830303 Cherry Hill NaN \n",
|
790 |
+
"\n",
|
791 |
+
"[1258740 rows x 14 columns]"
|
792 |
+
]
|
793 |
+
},
|
794 |
+
"execution_count": 32,
|
795 |
+
"metadata": {},
|
796 |
+
"output_type": "execute_result"
|
797 |
+
}
|
798 |
+
],
|
799 |
+
"source": [
|
800 |
+
"final_df = combined_df\n",
|
801 |
+
"\n",
|
802 |
+
"for index, row in final_df.iterrows():\n",
|
803 |
+
" if row[\"RegionType\"] == \"city\":\n",
|
804 |
+
" final_df.at[index, \"City\"] = row[\"RegionName\"]\n",
|
805 |
+
" elif row[\"RegionType\"] == \"county\":\n",
|
806 |
+
" final_df.at[index, \"County\"] = row[\"RegionName\"]\n",
|
807 |
+
"\n",
|
808 |
+
"# coalesce State and StateName columns\n",
|
809 |
+
"final_df[\"State\"] = final_df[\"State\"].combine_first(final_df[\"StateName\"])\n",
|
810 |
+
"final_df[\"State\"] = final_df[\"County\"].combine_first(final_df[\"CountyName\"])\n",
|
811 |
+
"\n",
|
812 |
+
"final_df = final_df.drop(columns=[\"StateName\", \"CountyName\"])\n",
|
813 |
+
"final_df"
|
814 |
+
]
|
815 |
+
},
|
816 |
+
{
|
817 |
+
"cell_type": "code",
|
818 |
+
"execution_count": 33,
|
819 |
"metadata": {},
|
820 |
"outputs": [
|
821 |
{
|
|
|
843 |
" <th>Size Rank</th>\n",
|
844 |
" <th>Region</th>\n",
|
845 |
" <th>Region Type</th>\n",
|
|
|
846 |
" <th>Home Type</th>\n",
|
847 |
+
" <th>State</th>\n",
|
848 |
+
" <th>Metro</th>\n",
|
849 |
+
" <th>State Code FIPS</th>\n",
|
850 |
+
" <th>Municipal Code FIPS</th>\n",
|
851 |
" <th>Date</th>\n",
|
852 |
" <th>Rent (Smoothed)</th>\n",
|
853 |
" <th>Rent (Smoothed) (Seasonally Adjusted)</th>\n",
|
854 |
+
" <th>City</th>\n",
|
855 |
+
" <th>County</th>\n",
|
856 |
" </tr>\n",
|
857 |
" </thead>\n",
|
858 |
" <tbody>\n",
|
859 |
" <tr>\n",
|
860 |
" <th>0</th>\n",
|
861 |
+
" <td>66</td>\n",
|
862 |
+
" <td>146</td>\n",
|
863 |
+
" <td>Ada County</td>\n",
|
864 |
+
" <td>county</td>\n",
|
865 |
+
" <td>all homes plus multifamily</td>\n",
|
866 |
+
" <td>Ada County</td>\n",
|
867 |
+
" <td>Boise City, ID</td>\n",
|
868 |
+
" <td>16.0</td>\n",
|
869 |
+
" <td>1.0</td>\n",
|
870 |
" <td>2015-01-31</td>\n",
|
871 |
+
" <td>927.493763</td>\n",
|
872 |
+
" <td>927.493763</td>\n",
|
873 |
+
" <td>NaN</td>\n",
|
874 |
+
" <td>Ada County</td>\n",
|
875 |
" </tr>\n",
|
876 |
" <tr>\n",
|
877 |
+
" <th>1</th>\n",
|
878 |
+
" <td>66</td>\n",
|
879 |
+
" <td>146</td>\n",
|
880 |
+
" <td>Ada County</td>\n",
|
881 |
+
" <td>county</td>\n",
|
882 |
+
" <td>all homes plus multifamily</td>\n",
|
883 |
+
" <td>Ada County</td>\n",
|
884 |
+
" <td>Boise City, ID</td>\n",
|
885 |
+
" <td>16.0</td>\n",
|
886 |
+
" <td>1.0</td>\n",
|
887 |
+
" <td>2015-02-28</td>\n",
|
888 |
+
" <td>931.690623</td>\n",
|
889 |
+
" <td>931.690623</td>\n",
|
890 |
" <td>NaN</td>\n",
|
891 |
+
" <td>Ada County</td>\n",
|
|
|
|
|
|
|
892 |
" </tr>\n",
|
893 |
" <tr>\n",
|
894 |
+
" <th>2</th>\n",
|
895 |
+
" <td>66</td>\n",
|
896 |
+
" <td>146</td>\n",
|
897 |
+
" <td>Ada County</td>\n",
|
898 |
+
" <td>county</td>\n",
|
899 |
+
" <td>all homes plus multifamily</td>\n",
|
900 |
+
" <td>Ada County</td>\n",
|
901 |
+
" <td>Boise City, ID</td>\n",
|
902 |
+
" <td>16.0</td>\n",
|
903 |
+
" <td>1.0</td>\n",
|
904 |
+
" <td>2015-03-31</td>\n",
|
905 |
+
" <td>932.568601</td>\n",
|
906 |
+
" <td>932.568601</td>\n",
|
907 |
" <td>NaN</td>\n",
|
908 |
+
" <td>Ada County</td>\n",
|
|
|
|
|
|
|
909 |
" </tr>\n",
|
910 |
" <tr>\n",
|
911 |
+
" <th>3</th>\n",
|
912 |
+
" <td>66</td>\n",
|
913 |
+
" <td>146</td>\n",
|
914 |
+
" <td>Ada County</td>\n",
|
915 |
+
" <td>county</td>\n",
|
916 |
+
" <td>all homes plus multifamily</td>\n",
|
917 |
+
" <td>Ada County</td>\n",
|
918 |
+
" <td>Boise City, ID</td>\n",
|
919 |
+
" <td>16.0</td>\n",
|
920 |
+
" <td>1.0</td>\n",
|
921 |
+
" <td>2015-04-30</td>\n",
|
922 |
+
" <td>933.148134</td>\n",
|
923 |
+
" <td>933.148134</td>\n",
|
924 |
" <td>NaN</td>\n",
|
925 |
+
" <td>Ada County</td>\n",
|
|
|
|
|
|
|
926 |
" </tr>\n",
|
927 |
" <tr>\n",
|
928 |
+
" <th>4</th>\n",
|
929 |
+
" <td>66</td>\n",
|
930 |
+
" <td>146</td>\n",
|
931 |
+
" <td>Ada County</td>\n",
|
932 |
+
" <td>county</td>\n",
|
933 |
+
" <td>all homes plus multifamily</td>\n",
|
934 |
+
" <td>Ada County</td>\n",
|
935 |
+
" <td>Boise City, ID</td>\n",
|
936 |
+
" <td>16.0</td>\n",
|
937 |
+
" <td>1.0</td>\n",
|
938 |
+
" <td>2015-05-31</td>\n",
|
939 |
+
" <td>941.045724</td>\n",
|
940 |
+
" <td>941.045724</td>\n",
|
941 |
" <td>NaN</td>\n",
|
942 |
+
" <td>Ada County</td>\n",
|
|
|
|
|
|
|
943 |
" </tr>\n",
|
944 |
" <tr>\n",
|
945 |
" <th>...</th>\n",
|
|
|
952 |
" <td>...</td>\n",
|
953 |
" <td>...</td>\n",
|
954 |
" <td>...</td>\n",
|
955 |
+
" <td>...</td>\n",
|
956 |
+
" <td>...</td>\n",
|
957 |
+
" <td>...</td>\n",
|
958 |
+
" <td>...</td>\n",
|
959 |
+
" <td>...</td>\n",
|
960 |
" </tr>\n",
|
961 |
" <tr>\n",
|
962 |
+
" <th>1258735</th>\n",
|
963 |
+
" <td>857850</td>\n",
|
964 |
+
" <td>713</td>\n",
|
965 |
+
" <td>Cherry Hill</td>\n",
|
966 |
+
" <td>city</td>\n",
|
967 |
+
" <td>all homes plus multifamily</td>\n",
|
968 |
+
" <td>Camden County</td>\n",
|
969 |
+
" <td>NaN</td>\n",
|
970 |
+
" <td>NaN</td>\n",
|
971 |
" <td>NaN</td>\n",
|
972 |
+
" <td>2023-08-31</td>\n",
|
973 |
+
" <td>2291.604800</td>\n",
|
974 |
+
" <td>2244.961006</td>\n",
|
975 |
+
" <td>Cherry Hill</td>\n",
|
976 |
" <td>NaN</td>\n",
|
977 |
" </tr>\n",
|
978 |
" <tr>\n",
|
979 |
+
" <th>1258736</th>\n",
|
980 |
+
" <td>857850</td>\n",
|
981 |
+
" <td>713</td>\n",
|
982 |
+
" <td>Cherry Hill</td>\n",
|
983 |
+
" <td>city</td>\n",
|
984 |
+
" <td>all homes plus multifamily</td>\n",
|
985 |
+
" <td>Camden County</td>\n",
|
|
|
986 |
" <td>NaN</td>\n",
|
987 |
" <td>NaN</td>\n",
|
988 |
+
" <td>NaN</td>\n",
|
989 |
+
" <td>2023-09-30</td>\n",
|
990 |
+
" <td>2296.188906</td>\n",
|
991 |
+
" <td>2254.213172</td>\n",
|
992 |
+
" <td>Cherry Hill</td>\n",
|
993 |
+
" <td>NaN</td>\n",
|
994 |
" </tr>\n",
|
995 |
" <tr>\n",
|
996 |
+
" <th>1258737</th>\n",
|
997 |
+
" <td>857850</td>\n",
|
998 |
+
" <td>713</td>\n",
|
999 |
+
" <td>Cherry Hill</td>\n",
|
1000 |
+
" <td>city</td>\n",
|
1001 |
+
" <td>all homes plus multifamily</td>\n",
|
1002 |
+
" <td>Camden County</td>\n",
|
1003 |
+
" <td>NaN</td>\n",
|
1004 |
+
" <td>NaN</td>\n",
|
1005 |
" <td>NaN</td>\n",
|
1006 |
+
" <td>2023-10-31</td>\n",
|
1007 |
+
" <td>2292.270938</td>\n",
|
1008 |
+
" <td>2261.540446</td>\n",
|
1009 |
+
" <td>Cherry Hill</td>\n",
|
1010 |
" <td>NaN</td>\n",
|
1011 |
" </tr>\n",
|
1012 |
" <tr>\n",
|
1013 |
+
" <th>1258738</th>\n",
|
1014 |
+
" <td>857850</td>\n",
|
1015 |
+
" <td>713</td>\n",
|
1016 |
+
" <td>Cherry Hill</td>\n",
|
1017 |
+
" <td>city</td>\n",
|
1018 |
+
" <td>all homes plus multifamily</td>\n",
|
1019 |
+
" <td>Camden County</td>\n",
|
1020 |
+
" <td>NaN</td>\n",
|
1021 |
+
" <td>NaN</td>\n",
|
1022 |
+
" <td>NaN</td>\n",
|
1023 |
" <td>2023-11-30</td>\n",
|
1024 |
+
" <td>2253.417140</td>\n",
|
1025 |
+
" <td>2257.956024</td>\n",
|
1026 |
+
" <td>Cherry Hill</td>\n",
|
1027 |
+
" <td>NaN</td>\n",
|
1028 |
" </tr>\n",
|
1029 |
" <tr>\n",
|
1030 |
+
" <th>1258739</th>\n",
|
1031 |
+
" <td>857850</td>\n",
|
1032 |
+
" <td>713</td>\n",
|
1033 |
+
" <td>Cherry Hill</td>\n",
|
1034 |
+
" <td>city</td>\n",
|
1035 |
+
" <td>all homes plus multifamily</td>\n",
|
1036 |
+
" <td>Camden County</td>\n",
|
1037 |
+
" <td>NaN</td>\n",
|
1038 |
+
" <td>NaN</td>\n",
|
1039 |
+
" <td>NaN</td>\n",
|
1040 |
" <td>2023-12-31</td>\n",
|
1041 |
+
" <td>2280.830303</td>\n",
|
1042 |
+
" <td>2280.830303</td>\n",
|
1043 |
+
" <td>Cherry Hill</td>\n",
|
1044 |
+
" <td>NaN</td>\n",
|
1045 |
" </tr>\n",
|
1046 |
" </tbody>\n",
|
1047 |
"</table>\n",
|
1048 |
+
"<p>1258740 rows × 14 columns</p>\n",
|
1049 |
"</div>"
|
1050 |
],
|
1051 |
"text/plain": [
|
1052 |
+
" Region ID Size Rank Region Region Type \\\n",
|
1053 |
+
"0 66 146 Ada County county \n",
|
1054 |
+
"1 66 146 Ada County county \n",
|
1055 |
+
"2 66 146 Ada County county \n",
|
1056 |
+
"3 66 146 Ada County county \n",
|
1057 |
+
"4 66 146 Ada County county \n",
|
1058 |
+
"... ... ... ... ... \n",
|
1059 |
+
"1258735 857850 713 Cherry Hill city \n",
|
1060 |
+
"1258736 857850 713 Cherry Hill city \n",
|
1061 |
+
"1258737 857850 713 Cherry Hill city \n",
|
1062 |
+
"1258738 857850 713 Cherry Hill city \n",
|
1063 |
+
"1258739 857850 713 Cherry Hill city \n",
|
1064 |
+
"\n",
|
1065 |
+
" Home Type State Metro \\\n",
|
1066 |
+
"0 all homes plus multifamily Ada County Boise City, ID \n",
|
1067 |
+
"1 all homes plus multifamily Ada County Boise City, ID \n",
|
1068 |
+
"2 all homes plus multifamily Ada County Boise City, ID \n",
|
1069 |
+
"3 all homes plus multifamily Ada County Boise City, ID \n",
|
1070 |
+
"4 all homes plus multifamily Ada County Boise City, ID \n",
|
1071 |
+
"... ... ... ... \n",
|
1072 |
+
"1258735 all homes plus multifamily Camden County NaN \n",
|
1073 |
+
"1258736 all homes plus multifamily Camden County NaN \n",
|
1074 |
+
"1258737 all homes plus multifamily Camden County NaN \n",
|
1075 |
+
"1258738 all homes plus multifamily Camden County NaN \n",
|
1076 |
+
"1258739 all homes plus multifamily Camden County NaN \n",
|
1077 |
"\n",
|
1078 |
+
" State Code FIPS Municipal Code FIPS Date Rent (Smoothed) \\\n",
|
1079 |
+
"0 16.0 1.0 2015-01-31 927.493763 \n",
|
1080 |
+
"1 16.0 1.0 2015-02-28 931.690623 \n",
|
1081 |
+
"2 16.0 1.0 2015-03-31 932.568601 \n",
|
1082 |
+
"3 16.0 1.0 2015-04-30 933.148134 \n",
|
1083 |
+
"4 16.0 1.0 2015-05-31 941.045724 \n",
|
1084 |
+
"... ... ... ... ... \n",
|
1085 |
+
"1258735 NaN NaN 2023-08-31 2291.604800 \n",
|
1086 |
+
"1258736 NaN NaN 2023-09-30 2296.188906 \n",
|
1087 |
+
"1258737 NaN NaN 2023-10-31 2292.270938 \n",
|
1088 |
+
"1258738 NaN NaN 2023-11-30 2253.417140 \n",
|
1089 |
+
"1258739 NaN NaN 2023-12-31 2280.830303 \n",
|
1090 |
"\n",
|
1091 |
+
" Rent (Smoothed) (Seasonally Adjusted) City County \n",
|
1092 |
+
"0 927.493763 NaN Ada County \n",
|
1093 |
+
"1 931.690623 NaN Ada County \n",
|
1094 |
+
"2 932.568601 NaN Ada County \n",
|
1095 |
+
"3 933.148134 NaN Ada County \n",
|
1096 |
+
"4 941.045724 NaN Ada County \n",
|
1097 |
+
"... ... ... ... \n",
|
1098 |
+
"1258735 2244.961006 Cherry Hill NaN \n",
|
1099 |
+
"1258736 2254.213172 Cherry Hill NaN \n",
|
1100 |
+
"1258737 2261.540446 Cherry Hill NaN \n",
|
1101 |
+
"1258738 2257.956024 Cherry Hill NaN \n",
|
1102 |
+
"1258739 2280.830303 Cherry Hill NaN \n",
|
1103 |
+
"\n",
|
1104 |
+
"[1258740 rows x 14 columns]"
|
1105 |
]
|
1106 |
},
|
1107 |
+
"execution_count": 33,
|
1108 |
"metadata": {},
|
1109 |
"output_type": "execute_result"
|
1110 |
}
|
1111 |
],
|
1112 |
"source": [
|
|
|
1113 |
"final_df = final_df.rename(\n",
|
1114 |
" columns={\n",
|
1115 |
" \"RegionID\": \"Region ID\",\n",
|
1116 |
" \"SizeRank\": \"Size Rank\",\n",
|
1117 |
" \"RegionName\": \"Region\",\n",
|
1118 |
" \"RegionType\": \"Region Type\",\n",
|
1119 |
+
" \"StateCodeFIPS\": \"State Code FIPS\",\n",
|
1120 |
+
" \"MunicipalCodeFIPS\": \"Municipal Code FIPS\",\n",
|
1121 |
" }\n",
|
1122 |
")\n",
|
1123 |
"\n",
|
1124 |
+
"final_df"
|
|
|
1125 |
]
|
1126 |
},
|
1127 |
{
|
1128 |
"cell_type": "code",
|
1129 |
+
"execution_count": 35,
|
1130 |
"metadata": {},
|
1131 |
"outputs": [],
|
1132 |
"source": [
|