Last active
September 21, 2023 16:47
-
-
Save jamesdamillington/4d4f53a61f0b9f96a05d547bd9246043 to your computer and use it in GitHub Desktop.
Testing mapclassify with geopandas
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 geopandas as gpd | |
import pandas as pd | |
england = pd.read_csv("https://raw.githubusercontent.com/jamesdamillington/spar/main/data/brexit/brexit_vote.csv", | |
index_col='Area_Code') | |
lads = gpd.read_file("https://raw.githubusercontent.com/jamesdamillington/spar/main/data/brexit/local_authority_districts.geojson").set_index('lad16cd') | |
Egdf = lads.merge(england, how='inner', | |
left_index=True, right_index=True) | |
col='Pct_Leave' | |
Egdf.plot(column=col, cmap='viridis', | |
scheme='quantiles', k=5, | |
linewidth=0., | |
legend=True, legend_kwds={"title":col,"loc": 2}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment