# How to merge polygons that have the same values in one column in Geopandas?

I have an shp. with these columns:

``````ind code area
1    12  200
1    12  100
1    12  23
2    30  223
2    30  112
3    29  234
4    20  232
5    23  211
``````

I want to combine each polygon with the same value in the `ind` column as one.

what I think is needed is a merge operation but how should I do it? Also will the area be summed of the polygons that will be one? for example will we have one row of `ind=1` that its `area` will be 323?

The examples with the merge are like this and involve two shp 's: how should I do with one shp?

``````# One GeoDataFrame of countries, one of Cities.
# Want to merge so we can get each city's country.
Out:
geometry               country
0  POLYGON ((61.21081709172574 35.65007233330923,...           Afghanistan
1  (POLYGON ((16.32652835456705 -5.87747039146621...                Angola
2  POLYGON ((20.59024743010491 41.85540416113361,...               Albania
3  POLYGON ((51.57951867046327 24.24549713795111,...  United Arab Emirates
4  (POLYGON ((-65.50000000000003 -55.199999999999...             Argentina

Out:
name                                     geometry
0  Vatican City  POINT (12.45338654497177 41.90328217996012)
1    San Marino    POINT (12.44177015780014 43.936095834768)
3    Luxembourg  POINT (6.130002806227083 49.61166037912108)
4       Palikir  POINT (158.1499743237623 6.916643696007725)

# Execute spatial join
In : cities_with_country = gpd.sjoin(cities, countries, how="inner", op='intersects')
``````

I think you want to take a look at the `dissolve` method, where you can group by a certain column, take the union of the geometries for each group, and do another aggregation method on the other columns.
For example, with the countries example:

``````continents = countries.dissolve(by='continent', aggfunc='sum')
``````

``````gdf.dissolve(by='ind', aggfunc='sum')