Code
import contextily as ctx
import geopandas as gpd
import matplotlib.pyplot as plt
from geosnap import DataStore
from geosnap import analyze as gaz
from geosnap import io as gio
from geosnap import visualize as gvz
import contextily as ctx
import geopandas as gpd
import matplotlib.pyplot as plt
from geosnap import DataStore
from geosnap import analyze as gaz
from geosnap import io as gio
from geosnap import visualize as gvz
%load_ext watermark
%watermark -a 'eli knaap' -iv -d -u
Author: eli knaap
Last updated: 2024-03-28
geosnap : 0.12.1.dev9+g3a1cb0f6de61.d20240110
contextily: 1.4.0
matplotlib: 3.8.2
geopandas : 0.14.2
As with geodemographic clustering, when carrying out a regionalization exercise, we are searching for groups of observations (census tracts in this case) which are similar in socioeconomic and demographic composition. If the goal of geodemographics is to identify neighborhood types, that could exist anywhere in the region, the goal of regionalization is to identify specific neighborhoods that exist at a distinct place in the region
Following that concept, we can use constrained clustering to develop an empirical version of geographically-bounded neighborhoods, where the neighborhoods are defined by internal social homogeneity. This is similar to the historic and well-defined neighborhood zones in places like Chicago and Pittsburgh.
from IPython.display import Image
Image("https://upload.wikimedia.org/wikipedia/commons/b/b3/Chicago_neighborhoods_map.png",
=700,
width )
https://en.wikivoyage.org/wiki/File:Chicago_neighborhoods_map.png
Image("https://visit-pittsburgh-2023.s3.amazonaws.com/images/archive/2020-Neighborhood-Map2.jpg",
=700,
width )
https://www.visitpittsburgh.com/neighborhoods/
= DataStore() datasets
= gio.get_acs(datasets, county_fips="06037", years=2021, level="tract") la
/Users/knaaptime/Dropbox/projects/geosnap/geosnap/io/util.py:275: UserWarning: Unable to find local adjustment year for 2021. Attempting from online data
warn(
/Users/knaaptime/Dropbox/projects/geosnap/geosnap/io/constructors.py:215: UserWarning: Currency columns unavailable at this resolution; not adjusting for inflation
warn(
"median_household_income", "geometry"]].explore(
la[["median_household_income",
="quantiles",
scheme=8,
k="magma",
cmap="CartoDB Positron",
tiles )