Quick utility function in python to geo-spatially cluster a pandas dataframe table carrying latitude-longitude into N clusters
This will take a df and add a cluster column to it (you can change defaults by adding arguments to your function), carrying cluster number 1 to N
There are more customizations to kmeans that I haven't gone into, please explore them at https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html#sklearn.cluster.KMeans
required python packages installations:
pip install pandas scikit-learn