\n", + " | value | \n", + "
---|---|
year | \n", + "\n", + " |
2007 | \n", + "276616.666667 | \n", + "
2008 | \n", + "221875.000000 | \n", + "
2009 | \n", + "188391.666667 | \n", + "
2010 | \n", + "176216.666667 | \n", + "
2011 | \n", + "154766.666667 | \n", + "
14898 rows × 21 columns
\n", + "14898 rows × 21 columns
\n", "" ], "text/plain": [ @@ -3633,7 +3896,7 @@ "[14898 rows x 21 columns]" ] }, - "execution_count": 87, + "execution_count": 107, "metadata": {}, "output_type": "execute_result" } @@ -3651,7 +3914,7 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 108, "metadata": {}, "outputs": [], "source": [ @@ -3660,7 +3923,7 @@ }, { "cell_type": "code", - "execution_count": 89, + "execution_count": 109, "metadata": {}, "outputs": [], "source": [ @@ -3669,7 +3932,7 @@ }, { "cell_type": "code", - "execution_count": 90, + "execution_count": 110, "metadata": {}, "outputs": [ { @@ -3754,7 +4017,7 @@ "4 Brimfield 3.103101 255700.0 0.060555 1010" ] }, - "execution_count": 90, + "execution_count": 110, "metadata": {}, "output_type": "execute_result" } @@ -3765,7 +4028,7 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 111, "metadata": {}, "outputs": [ { @@ -3779,7 +4042,7 @@ "dtype: object" ] }, - "execution_count": 91, + "execution_count": 111, "metadata": {}, "output_type": "execute_result" } @@ -3790,7 +4053,7 @@ }, { "cell_type": "code", - "execution_count": 92, + "execution_count": 112, "metadata": {}, "outputs": [ { @@ -3799,7 +4062,7 @@ "0.000671231" ] }, - "execution_count": 92, + "execution_count": 112, "metadata": {}, "output_type": "execute_result" } @@ -3810,7 +4073,7 @@ }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 113, "metadata": {}, "outputs": [ { @@ -3819,7 +4082,7 @@ "10.0" ] }, - "execution_count": 93, + "execution_count": 113, "metadata": {}, "output_type": "execute_result" } @@ -3830,18 +4093,18 @@ }, { "cell_type": "code", - "execution_count": 94, + "execution_count": 114, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "C:\\Users\\shi10484\\AppData\\Local\\ESRI\\conda\\envs\\dl_testing2\\lib\\site-packages\\pandas\\core\\frame.py:4301: SettingWithCopyWarning: \n", + "C:\\Users\\shu12142\\AppData\\Local\\Temp\\1\\ipykernel_26008\\1442553068.py:1: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", - " errors=errors,\n" + " matket_health_index.rename(columns={\"zipstring\": \"ZIP_CODE\"},\n" ] } ], @@ -3852,7 +4115,7 @@ }, { "cell_type": "code", - "execution_count": 95, + "execution_count": 115, "metadata": {}, "outputs": [ { @@ -3910,7 +4173,7 @@ "13353 Crestline 2.882937 228900.0 0.067296 92325" ] }, - "execution_count": 95, + "execution_count": 115, "metadata": {}, "output_type": "execute_result" } @@ -3926,9 +4189,16 @@ "4) Sort the table on the ZIP_CODE field so we can locate their ZIP Code. Make a note of the values for MarketHealthIndex, ZHVI, and ForecastYoYPctChange. In Crestline, for example, the market health index is fair: 6.4 on a scale that ranges from 0 to 10. The median home value for all homes (not just 3-bedroom homes) is $214,100. Homes are expected to appreciate 4.8 percent." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We also want to merge the zip_code layer with market_health_index layer to visualize the result on map." + ] + }, { "cell_type": "code", - "execution_count": 96, + "execution_count": 116, "metadata": { "scrolled": true }, @@ -3955,105 +4225,105 @@ "8 rows × 66 columns
\n", + "11 rows × 65 columns
\n", "" ], "text/plain": [ - " OBJECTID FID_AC9111_A7E54F7D id source_country x y \\\n", - "0 6 1 0 US -117.552830 34.064356 \n", - "1 9 1 0 US -117.552830 34.064356 \n", - "2 19 1 0 US -117.552830 34.064356 \n", - "3 20 1 0 US -117.552830 34.064356 \n", - "4 29 1 0 US -117.552830 34.064356 \n", - "5 30 1 0 US -117.552830 34.064356 \n", - "6 179 1 0 US -117.552830 34.064356 \n", - "7 180 2 1 US -117.194872 34.057237 \n", + " OBJECTID_1 FID_DRIVETIMELAYER_20242_DRIVET source_cou x \\\n", + "0 2 1 USA -117.552866 \n", + "1 4 1 USA -117.552866 \n", + "2 14 1 USA -117.552866 \n", + "3 18 1 USA -117.552866 \n", + "4 20 1 USA -117.552866 \n", + "5 35 1 USA -117.552866 \n", + "6 36 1 USA -117.552866 \n", + "7 45 1 USA -117.552866 \n", + "8 46 1 USA -117.552866 \n", + "9 213 1 USA -117.552866 \n", + "10 214 2 USA -117.19479 \n", "\n", - " area_type buffer_units buffer_units_alias buffer_radii ... \\\n", - "0 NetworkServiceArea Minutes Drive Time Minutes 45 ... \n", - "1 NetworkServiceArea Minutes Drive Time Minutes 45 ... \n", - "2 NetworkServiceArea Minutes Drive Time Minutes 45 ... \n", - "3 NetworkServiceArea Minutes Drive Time Minutes 45 ... \n", - "4 NetworkServiceArea Minutes Drive Time Minutes 45 ... \n", - "5 NetworkServiceArea Minutes Drive Time Minutes 45 ... \n", - "6 NetworkServiceArea Minutes Drive Time Minutes 45 ... \n", - "7 NetworkServiceArea Minutes Drive Time Minutes 45 ... \n", + " y area_type buffer_uni buffer_u_1 buffer_rad \\\n", + "0 34.064359 NetworkServiceArea Minutes Drive Time Minutes 45.0 \n", + "1 34.064359 NetworkServiceArea Minutes Drive Time Minutes 45.0 \n", + "2 34.064359 NetworkServiceArea Minutes Drive Time Minutes 45.0 \n", + "3 34.064359 NetworkServiceArea Minutes Drive Time Minutes 45.0 \n", + "4 34.064359 NetworkServiceArea Minutes Drive Time Minutes 45.0 \n", + "5 34.064359 NetworkServiceArea Minutes Drive Time Minutes 45.0 \n", + "6 34.064359 NetworkServiceArea Minutes Drive Time Minutes 45.0 \n", + "7 34.064359 NetworkServiceArea Minutes Drive Time Minutes 45.0 \n", + "8 34.064359 NetworkServiceArea Minutes Drive Time Minutes 45.0 \n", + "9 34.064359 NetworkServiceArea Minutes Drive Time Minutes 45.0 \n", + "10 34.057265 NetworkServiceArea Minutes Drive Time Minutes 45.0 \n", "\n", - " state zip_code city market_health_index zhvi \\\n", - "0 CA 90606 West Whittier-Los Nietos 8.272251 485500 \n", - "1 CA 90640 Montebello 8.167539 538500 \n", - "2 CA 91702 Azusa 9.138139 457600 \n", - "3 CA 91706 Baldwin Park 9.215331 460300 \n", - "4 CA 91732 El Monte 9.203249 506500 \n", - "5 CA 91733 South El Monte 9.615385 501700 \n", - "6 CA 91752 Eastvale 8.270909 503800 \n", - "7 CA 91752 Eastvale 8.270909 503800 \n", + " aggregatio ... sqmi shape_leng \\\n", + "0 BlockApportionment:US.BlockGroups;PointsLayer:... ... 4.2 0.214615 \n", + "1 BlockApportionment:US.BlockGroups;PointsLayer:... ... 3.01 0.147502 \n", + "2 BlockApportionment:US.BlockGroups;PointsLayer:... ... 3.74 0.183214 \n", + "3 BlockApportionment:US.BlockGroups;PointsLayer:... ... 8.23 0.28339 \n", + "4 BlockApportionment:US.BlockGroups;PointsLayer:... ... 8.53 0.438871 \n", + "5 BlockApportionment:US.BlockGroups;PointsLayer:... ... 69.99 1.187015 \n", + "6 BlockApportionment:US.BlockGroups;PointsLayer:... ... 15.37 0.381127 \n", + "7 BlockApportionment:US.BlockGroups;PointsLayer:... ... 4.8 0.210419 \n", + "8 BlockApportionment:US.BlockGroups;PointsLayer:... ... 6.99 0.228549 \n", + "9 BlockApportionment:US.BlockGroups;PointsLayer:... ... 15.19 0.305009 \n", + "10 BlockApportionment:US.BlockGroups;PointsLayer:... ... 15.19 0.305009 \n", "\n", - " forecast_yo_y_pct_change Shape__Area_1 Shape__Length_1 AnalysisArea \\\n", - "0 0.072375 1.417656e+07 22316.323033 2.240247 \n", - "1 0.061807 3.105525e+07 34167.878635 1.995545 \n", - "2 0.086300 2.658000e+08 142848.234839 22.824592 \n", - "3 0.088173 5.812360e+07 45215.156466 39.756145 \n", - "4 0.065299 1.813936e+07 25827.620558 12.414794 \n", - "5 0.093255 2.645891e+07 27366.704306 17.640998 \n", - "6 0.064508 5.733285e+07 37863.197705 39.309396 \n", - "7 0.064508 5.733285e+07 37863.197705 39.309396 \n", + " city market_hea zhvi forecast_y \\\n", + "0 Los Angeles 9.055578 408100.0 0.09147 \n", + "1 Los Angeles 9.930192 472000.0 0.07689 \n", + "2 West Whittier-Los Nietos 8.272251 485500.0 0.072375 \n", + "3 Montebello 8.167539 538500.0 0.061807 \n", + "4 Santa Fe Springs 9.151564 494500.0 0.063482 \n", + "5 Azusa 9.138139 457600.0 0.0863 \n", + "6 Baldwin Park 9.215331 460300.0 0.088173 \n", + "7 El Monte 9.203249 506500.0 0.065299 \n", + "8 South El Monte 9.615385 501700.0 0.093255 \n", + "9 Eastvale 8.270909 503800.0 0.064508 \n", + "10 Eastvale 8.270909 503800.0 0.064508 \n", "\n", - " SHAPE \n", - "0 {\"rings\": [[[-13143194.2534, 4028915.1404], [-... \n", - "1 {\"rings\": [[[-13143598.3654, 4032788.2902], [-... \n", - "2 {\"rings\": [[[-13123459.7947, 4048654.942], [-1... \n", - "3 {\"rings\": [[[-13129357.7083, 4047200.0046], [-... \n", - "4 {\"rings\": [[[-13135851.7534, 4040662.4451], [-... \n", - "5 {\"rings\": [[[-13139099.6109, 4037245.849], [-1... \n", - "6 {\"rings\": [[[-13082747.7254, 4033299.2511], [-... \n", - "7 {\"rings\": [[[-13082747.7254, 4033299.2511], [-... \n", + " Shape__Area_1 Shape__Length_1 AnalysisArea \\\n", + "0 15880559.84375 25687.278616 0.482092 \n", + "1 11375466.695312 17800.685279 1.779017 \n", + "2 14136917.117188 22634.260753 8.36099 \n", + "3 31089924.613281 34373.962355 13.017801 \n", + "4 32164136.523438 53469.063308 2.26762 \n", + "5 265860978.933594 144989.856887 23.94345 \n", + "6 58195009.007812 46203.383216 39.805003 \n", + "7 18149214.558594 25938.507566 12.421541 \n", + "8 26450814.414062 27596.205783 18.114647 \n", + "9 57390709.253906 38277.204055 39.349068 \n", + "10 57390709.253906 38277.204055 39.349068 \n", + "\n", + " SHAPE \n", + "0 {\"rings\": [[[-13157517.9452, 4032773.4488], [-... \n", + "1 {\"rings\": [[[-13157514.1907, 4037443.2303], [-... \n", + "2 {\"rings\": [[[-13143194.2534, 4028915.1404], [-... \n", + "3 {\"rings\": [[[-13143598.3654, 4032788.2902], [-... \n", + "4 {\"rings\": [[[-13143509.5925, 4023388.3935], [-... \n", + "5 {\"rings\": [[[-13123457.5912, 4048674.4978], [-... \n", + "6 {\"rings\": [[[-13129355.916, 4047201.7934], [-1... \n", + "7 {\"rings\": [[[-13135851.7534, 4040662.4451], [-... \n", + "8 {\"rings\": [[[-13139099.6109, 4037245.849], [-1... \n", + "9 {\"rings\": [[[-13082747.7254, 4033299.2511], [-... \n", + "10 {\"rings\": [[[-13082747.7254, 4033299.2511], [-... \n", "\n", - "[8 rows x 66 columns]" + "[11 rows x 65 columns]" ] }, - "execution_count": 120, + "execution_count": 153, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "query_str = '((ZHVI > 350000) AND (ZHVI < 600000) AND (' + cur_field_name + ' > 8) AND (' + cur_field_name2 + '> 0.06)) AND (1=1)'\n", + "query_str = '((ZHVI > 350000) AND (ZHVI < 600000) AND (' + field_name + ' > 8) AND (' + field_name2 + '> 0.06)) AND (1=1)'\n", "\n", "zip_hlth_intersect_df = zip_hlth_intersect.query(where=query_str).sdf\n", "zip_hlth_intersect_df" @@ -4971,19 +5446,19 @@ }, { "cell_type": "code", - "execution_count": 117, + "execution_count": 160, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "