I have one geodataframe that contains polygons and corresponding land use category (e.g. agricultural, commercial, retail, residential, ...) and another that contains census tract polygons and corresponding population. I want to bring the population data from the 2nd dataframe into the first dataframe. Here is the code I'm using:
gdf_chi_pop = gpd.sjoin(gdf_chi, gdf_census, how='inner',op='intersects')
The problem is that gdf_chi_pop
has a bunch of extra polygons that don't exist in gdf_chi
, which is not what I'm wanting. I just want a new dataframe with populations for all the polygons that already exist in gdf_chi
. What I also need to know is how geopandas differentiates between intensive properties (e.g. temperature, sunny days per year, population density, fraction of dogs that are poodles) and extensive properties (e.g. population, number of poodles, number of stores that sell spatulas) in polygons when doing sjoin.