title: Clustering Many Coordinates and putting to Folium
body: <p>I have tried looking everywhere, and nothing seems to be working. I am trying to cluster 902,538 data points that include a latitude and longitude, but I can't seem to make it work! I have tried all sorts of clustering methods, and don't understand what is not working. Any tips?</p>
  
  <p>dfnypd is a crime report that includes latitudes and longitudes for all reported crimes in New York in a given timeframe.</p>
  
  <p>This is one of the codes I tried - giving me a ValueError: n_samples=2 should be >= n_clusters = 100</p>
  
  <p><code>dfnypd = dfnypd[['Latitude','Longitude']].apply(pd.to_numeric)</code></p>
  
  <p><code>clat = dfnypd['Latitude']</code></p>
  
  <p><code>clon = dfnypd['Longitude']</code></p>
  
  <p><code>from sklearn.cluster import KMeans</code></p>
  
  <p><code>X = np.array(([clat, clon]))</code></p>
  
  <p><code>kmeans = KMeans(n_clusters = 100, random_state = 0).fit(X)</code></p>
  
  <p>I am clustering it into groups so that I can plot them on a readable chart and assign weights to the different clusters based upon crimes committed in those clusters. I tried just plotting it all as a heatmap, but it takes way too much power.</p>