GeoDataFrame.dissolve(by=None, aggfunc='first', split_out=1, **kwargs)#

Dissolve geometries within groupby into a single geometry.

bystring, default None

Column whose values define groups to be dissolved. If None, whole GeoDataFrame is considered a single group.

aggfuncfunction, string or dict, default “first”

Aggregation function for manipulation of data associated with each group. Passed to dask groupby.agg method. Note that aggfunc needs to be applicable to all columns (i.e. "mean" cannot be used with string dtype). Select only required columns before dissolve or pass a dictionary mapping to aggfunc to specify the aggregation function for each column separately.

split_outint, default 1

Number of partitions of the output


keyword arguments passed to groupby


>>> ddf.dissolve("foo", split_out=12)
>>> ddf[["foo", "bar", "geometry"]].dissolve("foo", aggfunc="mean")
>>> ddf.dissolve("foo", aggfunc={"bar": "mean", "baz": "first"})