{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import os\n", "\n", "from helpers import (\n", " get_data_path_for_config,\n", " get_combined_df,\n", " save_final_df_as_jsonl,\n", " handle_slug_column_mappings,\n", " set_home_type,\n", ")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "CONFIG_NAME = \"home_values\"" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "processing City_zhvi_uc_condo_tier_0.33_0.67_sm_sa_month.csv\n", "processing City_zhvi_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Metro_zhvi_uc_sfrcondo_tier_0.67_1.0_sm_sa_month.csv\n", "processing County_zhvi_uc_sfrcondo_tier_0.67_1.0_sm_sa_month.csv\n", "processing Metro_zhvi_bdrmcnt_2_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing County_zhvi_bdrmcnt_4_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing County_zhvi_uc_sfr_tier_0.33_0.67_sm_sa_month.csv\n", "processing Neighborhood_zhvi_bdrmcnt_4_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing State_zhvi_uc_sfr_tier_0.33_0.67_sm_sa_month.csv\n", "processing County_zhvi_uc_condo_tier_0.33_0.67_sm_sa_month.csv\n", "processing City_zhvi_bdrmcnt_4_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing State_zhvi_bdrmcnt_5_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Zip_zhvi_bdrmcnt_2_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing City_zhvi_uc_sfrcondo_tier_0.67_1.0_sm_sa_month.csv\n", "processing Zip_zhvi_uc_condo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Neighborhood_zhvi_uc_sfr_sm_sa_month.csv\n", "processing Metro_zhvi_uc_sfr_tier_0.33_0.67_sm_sa_month.csv\n", "processing State_zhvi_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Zip_zhvi_bdrmcnt_1_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing County_zhvi_bdrmcnt_5_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Metro_zhvi_uc_condo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Metro_zhvi_bdrmcnt_3_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Neighborhood_zhvi_bdrmcnt_5_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Zip_zhvi_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing State_zhvi_uc_sfrcondo_tier_0.0_0.33_sm_sa_month.csv\n", "processing Metro_zhvi_bdrmcnt_1_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Zip_zhvi_uc_sfr_tier_0.33_0.67_sm_sa_month.csv\n", "processing City_zhvi_bdrmcnt_5_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing State_zhvi_bdrmcnt_4_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing State_zhvi_uc_condo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Zip_zhvi_bdrmcnt_3_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Neighborhood_zhvi_bdrmcnt_1_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing City_zhvi_bdrmcnt_3_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing County_zhvi_bdrmcnt_1_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Neighborhood_zhvi_uc_condo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Metro_zhvi_uc_sfrcondo_tier_0.33_0.67_month.csv\n", "processing Zip_zhvi_bdrmcnt_5_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing County_zhvi_uc_sfrcondo_tier_0.0_0.33_sm_sa_month.csv\n", "processing State_zhvi_bdrmcnt_2_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Metro_zhvi_uc_sfrcondo_tier_0.0_0.33_sm_sa_month.csv\n", "processing City_zhvi_uc_sfr_tier_0.33_0.67_sm_sa_month.csv\n", "processing City_zhvi_bdrmcnt_1_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Neighborhood_zhvi_bdrmcnt_3_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Metro_zhvi_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Metro_zhvi_bdrmcnt_5_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing County_zhvi_bdrmcnt_3_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing City_zhvi_bdrmcnt_2_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Neighborhood_zhvi_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing State_zhvi_uc_sfrcondo_tier_0.67_1.0_sm_sa_month.csv\n", "processing Zip_zhvi_bdrmcnt_4_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing State_zhvi_bdrmcnt_3_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing State_zhvi_bdrmcnt_1_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Neighborhood_zhvi_bdrmcnt_2_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing County_zhvi_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing County_zhvi_bdrmcnt_2_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n", "processing Metro_zhvi_bdrmcnt_4_uc_sfrcondo_tier_0.33_0.67_sm_sa_month.csv\n" ] }, { "data": { "text/html": [ "
\n", " | RegionID | \n", "SizeRank | \n", "RegionName | \n", "RegionType | \n", "StateName | \n", "Bedroom Count | \n", "Home Type | \n", "Date | \n", "Mid Tier ZHVI (Smoothed) (Seasonally Adjusted) | \n", "Bottom Tier ZHVI (Smoothed) (Seasonally Adjusted) | \n", "Top Tier ZHVI (Smoothed) (Seasonally Adjusted) | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "nan | \n", "1-Bedroom | \n", "all homes | \n", "2000-01-31 | \n", "81310.639504 | \n", "NaN | \n", "NaN | \n", "
1 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "nan | \n", "1-Bedroom | \n", "all homes | \n", "2000-02-29 | \n", "80419.761984 | \n", "NaN | \n", "NaN | \n", "
2 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "nan | \n", "1-Bedroom | \n", "all homes | \n", "2000-03-31 | \n", "80480.449461 | \n", "NaN | \n", "NaN | \n", "
3 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "nan | \n", "1-Bedroom | \n", "all homes | \n", "2000-04-30 | \n", "79799.206525 | \n", "NaN | \n", "NaN | \n", "
4 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "nan | \n", "1-Bedroom | \n", "all homes | \n", "2000-05-31 | \n", "79666.469861 | \n", "NaN | \n", "NaN | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
117907 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "nan | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-09-30 | \n", "486974.735908 | \n", "NaN | \n", "NaN | \n", "
117908 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "nan | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-10-31 | \n", "485847.539614 | \n", "NaN | \n", "NaN | \n", "
117909 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "nan | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-11-30 | \n", "484223.885775 | \n", "NaN | \n", "NaN | \n", "
117910 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "nan | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-12-31 | \n", "481522.403338 | \n", "NaN | \n", "NaN | \n", "
117911 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "nan | \n", "All Bedrooms | \n", "condo/co-op | \n", "2024-01-31 | \n", "481181.718200 | \n", "NaN | \n", "NaN | \n", "
117912 rows × 11 columns
\n", "\n", " | RegionID | \n", "SizeRank | \n", "RegionName | \n", "RegionType | \n", "StateName | \n", "Bedroom Count | \n", "Home Type | \n", "Date | \n", "Mid Tier ZHVI (Smoothed) (Seasonally Adjusted) | \n", "Bottom Tier ZHVI (Smoothed) (Seasonally Adjusted) | \n", "Top Tier ZHVI (Smoothed) (Seasonally Adjusted) | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "Alaska | \n", "1-Bedroom | \n", "all homes | \n", "2000-01-31 | \n", "81310.639504 | \n", "NaN | \n", "NaN | \n", "
1 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "Alaska | \n", "1-Bedroom | \n", "all homes | \n", "2000-02-29 | \n", "80419.761984 | \n", "NaN | \n", "NaN | \n", "
2 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "Alaska | \n", "1-Bedroom | \n", "all homes | \n", "2000-03-31 | \n", "80480.449461 | \n", "NaN | \n", "NaN | \n", "
3 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "Alaska | \n", "1-Bedroom | \n", "all homes | \n", "2000-04-30 | \n", "79799.206525 | \n", "NaN | \n", "NaN | \n", "
4 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "Alaska | \n", "1-Bedroom | \n", "all homes | \n", "2000-05-31 | \n", "79666.469861 | \n", "NaN | \n", "NaN | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
117907 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "Wyoming | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-09-30 | \n", "486974.735908 | \n", "NaN | \n", "NaN | \n", "
117908 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "Wyoming | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-10-31 | \n", "485847.539614 | \n", "NaN | \n", "NaN | \n", "
117909 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "Wyoming | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-11-30 | \n", "484223.885775 | \n", "NaN | \n", "NaN | \n", "
117910 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "Wyoming | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-12-31 | \n", "481522.403338 | \n", "NaN | \n", "NaN | \n", "
117911 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "Wyoming | \n", "All Bedrooms | \n", "condo/co-op | \n", "2024-01-31 | \n", "481181.718200 | \n", "NaN | \n", "NaN | \n", "
117912 rows × 11 columns
\n", "\n", " | Region ID | \n", "Size Rank | \n", "Region | \n", "Region Type | \n", "State | \n", "Bedroom Count | \n", "Home Type | \n", "Date | \n", "Mid Tier ZHVI (Smoothed) (Seasonally Adjusted) | \n", "Bottom Tier ZHVI (Smoothed) (Seasonally Adjusted) | \n", "Top Tier ZHVI (Smoothed) (Seasonally Adjusted) | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "Alaska | \n", "1-Bedroom | \n", "all homes | \n", "2000-01-31 | \n", "81310.639504 | \n", "NaN | \n", "NaN | \n", "
1 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "Alaska | \n", "1-Bedroom | \n", "all homes | \n", "2000-02-29 | \n", "80419.761984 | \n", "NaN | \n", "NaN | \n", "
2 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "Alaska | \n", "1-Bedroom | \n", "all homes | \n", "2000-03-31 | \n", "80480.449461 | \n", "NaN | \n", "NaN | \n", "
3 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "Alaska | \n", "1-Bedroom | \n", "all homes | \n", "2000-04-30 | \n", "79799.206525 | \n", "NaN | \n", "NaN | \n", "
4 | \n", "3 | \n", "48 | \n", "Alaska | \n", "state | \n", "Alaska | \n", "1-Bedroom | \n", "all homes | \n", "2000-05-31 | \n", "79666.469861 | \n", "NaN | \n", "NaN | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
117907 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "Wyoming | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-09-30 | \n", "486974.735908 | \n", "NaN | \n", "NaN | \n", "
117908 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "Wyoming | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-10-31 | \n", "485847.539614 | \n", "NaN | \n", "NaN | \n", "
117909 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "Wyoming | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-11-30 | \n", "484223.885775 | \n", "NaN | \n", "NaN | \n", "
117910 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "Wyoming | \n", "All Bedrooms | \n", "condo/co-op | \n", "2023-12-31 | \n", "481522.403338 | \n", "NaN | \n", "NaN | \n", "
117911 | \n", "62 | \n", "51 | \n", "Wyoming | \n", "state | \n", "Wyoming | \n", "All Bedrooms | \n", "condo/co-op | \n", "2024-01-31 | \n", "481181.718200 | \n", "NaN | \n", "NaN | \n", "
117912 rows × 11 columns
\n", "