Suppose we want to know the electricity emissions profile for any county? Or suppose we're curious about
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 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')
Mathematical Statistics With Applications In R
ISBN: 9780124171138
2nd Edition
Authors: Chris P. Tsokos, K.M. Ramachandran