code: def natural_breaks(values, k=5):
      
      values = np.array(values)
      uv = np.unique(values)
      uvk = len(uv)
      if uvk < k:
          Warn('Warning: Not enough unique values in array to form k classes',
               UserWarning)
          Warn('Warning: setting k to %d' % uvk, UserWarning)
          k = uvk
      kres = _kmeans(values, k)
      sids = kres[-1]  # centroids
      fit = kres[-2]
      class_ids = kres[0]
      cuts = kres[1]
      return (sids, class_ids, fit, cuts)
docs: natural breaks helper function
  
      Jenks natural breaks is kmeans in one dimension