This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proj = gplt.crs.AlbersEqualArea( | |
central_longitude=-98, | |
central_latitude=39.5 | |
) | |
ax = gplt.voronoi( | |
continental_usa_cities, | |
hue="ELEV_IN_FT", | |
clip=contiguous_usa, | |
projection=proj, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
melbourne = gpd.read_file(gplt.datasets.get_path("melbourne")) | |
df = gpd.read_file(gplt.datasets.get_path("melbourne_schools")) | |
melbourne_primary_schools = df.query('School_Type == "Primary"') | |
ax = gplt.voronoi( | |
melbourne_primary_schools, | |
clip=melbourne, | |
linewidth=0.5, | |
edgecolor="white", | |
projection=gcrs.Mercator() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import warnings | |
warnings.filterwarnings("ignore", "GeoSeries.isna", UserWarning) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gplt.pointplot( | |
continental_usa_cities, | |
projection=gcrs.AlbersEqualArea(), | |
hue="ELEV_IN_FT", | |
scheme=scheme, | |
cmap="inferno_r", | |
legend=True | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scheme = mc.Quantiles(continental_usa_cities["ELEV_IN_FT"], k=10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gplt.cartogram( | |
geo_obesity, | |
scale="Percent", | |
projection=gcrs.AlbersEqualArea() | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
geo_obesity = contiguous_usa.set_index("state").join(obesity.set_index("State")) | |
geo_obesity.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obesity = pd.read_csv(gplt.datasets.get_path("obesity_by_state"), sep="\t") | |
obesity.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ax = gplt.polyplot(contiguous_usa, projection=gcrs.AlbersEqualArea()) | |
gplt.kdeplot( | |
continental_usa_cities, | |
cmap="Reds", | |
shade=True, | |
clip=contiguous_usa, | |
ax=ax | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boroughs = gpd.read_file(gplt.datasets.get_path("nyc_boroughs")) | |
collisions = gpd.read_file(gplt.datasets.get_path("nyc_collision_factors")) | |
ax = gplt.polyplot(boroughs, projection=gcrs.AlbersEqualArea()) | |
gplt.kdeplot(collisions, cmap="Reds", shade=True, clip=boroughs, ax=ax) |