geopandas.GeoDataFrame.dissolve

GeoDataFrame.dissolve(self, by=None, aggfunc='first', as_index=True)

Dissolve geometries within groupby into single observation. This is accomplished by applying the unary_union method to all geometries within a groupself.

Observations associated with each groupby group will be aggregated using the aggfunc.

Parameters
bystring, default None

Column whose values define groups to be dissolved

aggfuncfunction or string, default “first”

Aggregation function for manipulation of data associated with each group. Passed to pandas groupby.agg method.

as_indexboolean, default True

If true, groupby columns become index of result.

Returns
GeoDataFrame