title: Draw polygons around a set of points and create clusters in python
body: <p>I have a Pandas DataFrame containing <code>Lat</code>, <code>Long</code> coordinates. How do I draw non-overlapping polygons around a cluster of points and aggregate the geometries in a geopandas DataFrame. Below is sample code to work with:</p>
  <pre><code>import pandas as pd
  import numpy as np
  import geopandas as gpd
  
  df = pd.DataFrame({
                     'yr': [2018, 2017, 2018, 2016],
                     'id': [0, 1, 2, 3],
                     'v': [10, 12, 8, 10],
                     'lat': [32.7418248, 32.8340583, 32.8340583, 32.7471895],
                     'lon':[-97.524066, -97.0805484, -97.0805484, -96.9400779]
                   })
  
  df = gpd.GeoDataFrame(df, geometry=gpd.points_from_xy(df['Long'], df['Lat']))
  
  # set crs for buffer calculations
  df.set_crs(&quot;ESRI:102003&quot;, inplace=True)
  </code></pre>
  <p>The Polygons can be of any shape, however, must include a minimum of 5 points. I tried creating a buffer around the points but circle is not the ideal solution. I am looking for a way to draw a more flexible polygon.</p>
  <p>This polygon representation will be added as a new column to the pandas dataframe containing the points.</p>
  <p><a href="https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.buffer.html" rel="nofollow noreferrer">https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoSeries.buffer.html</a></p>
  <p><a href="https://i.stack.imgur.com/u3QfVm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u3QfVm.jpg" alt="enter image description here" /></a></p>