I downloaded a geojson file of a city and was able to load it using geopandas. The city is made up of different wards each of which is a MultiPolygon. Now to check if a point lies inside the city or not, I did a union of all the rows of the dataframe and created a polygon of the whole city. This way I was able to check where the point lies without iterating through the whole dataframe

city = unary_union(city_geodf['geometry'])
city.contains(point)
Now the problem is, I want to find inside which ward specifically that point lies, and the only way I can think of doing that is to iterate through the whole dataframe. Is there any efficient way to solve this? Like when I am checking if a point is inside the city, can it also return the ward number?



