Question
Suppose we want to know the electricity emissions profile for any county? Or suppose we're curious about the per capita generation and emissions in each
Suppose we want to know the electricity emissions profile for any county? Or suppose we're curious about the per capita generation and emissions in each eGRID subregion, but we need to estimate the population within each subregion? Let us assign each county to a subregion: This will necessarily be an approximation, but hopefully it's close enough.
Part (A) {-}
1.Using the centroids for each county, assign each county to a subregion only if it's centroid is contained within that subregion polygon. Note you will need to add a column for the county centroids.
eGrid_gdf =r'C:\Users\ghwan\Downloads\eGRID2021_subregions_shapefile.zip'
subregion_gdf = gpd.read_file(eGrid_gdf)
#subregion_gdf
subregion_gdf = subregion_gdf.to_crs(5070)
subregion_gdf['centroid_column'] = subregion_gdf.geometry.centroid
egrid_url = r'C:\Users\ghwan\Downloads\eGRID2021_data.xlsx'
egrid = pd.read_excel(egrid_url, sheet_name = 'SRL21', header = 1)
#1 Merge these two variables with your subregion map
egrid_subset = egrid[['SUBRGN', 'SRNGENAN', 'SRCO2AN']]
# Merge with the subregion GeoDataFrame
merged_gdf = pd.merge(subregion_gdf, egrid_subset, left_on='SUBRGN', right_on='SUBRGN', how='left')
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started