Commit d11bd0fd authored by Jared Rennie's avatar Jared Rennie
Browse files

fixed joined to match FIPS codes from UNMC team

parent f12ac32c
......@@ -93,6 +93,12 @@ result=gpd.sjoin(geo_shapefile,geo_grid,how="inner", op="intersects")
# Take the Aggregate Mean By County
result_mean=result.groupby(['GEOID'],as_index=False).mean()[['GEOID', inCode0]]
# Join Results with CONUS Counties, to reconcile missing counties during Spatial Join
conus_counties=pd.read_csv(main_directory+'/counties.csv')
conus_counties['GEOID']=conus_counties['GEOID'].astype(str).apply(lambda x: x.zfill(5))
merge_conus=conus_counties.merge(result_mean, on='GEOID', how='left')
result_mean=merge_conus
# Insert and Reformat Columns
result_mean=result_mean.rename(columns={inCode0: inCode1})
result_mean[inCode1]=result_mean[inCode1].round(decimals=1)
......
......@@ -93,6 +93,12 @@ result=gpd.sjoin(geo_shapefile,geo_grid,how="inner", op="intersects")
# Take the Aggregate Mean By County
result_mean=result.groupby(['GEOID'],as_index=False).mean()[['GEOID', inCode0]]
# Join Results with CONUS Counties, to reconcile missing counties during Spatial Join
conus_counties=pd.read_csv(main_directory+'/counties.csv')
conus_counties['GEOID']=conus_counties['GEOID'].astype(str).apply(lambda x: x.zfill(5))
merge_conus=conus_counties.merge(result_mean, on='GEOID', how='left')
result_mean=merge_conus
# Insert and Reformat Columns
result_mean=result_mean.rename(columns={inCode0: inCode1})
result_mean[inCode1]=result_mean[inCode1].round(decimals=1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment