code: def ks_summary(pareto_tail_indices):
      
      kcounts, _ = np.histogram(pareto_tail_indices, bins=[-np.Inf, 0.5, 0.7, 1, np.Inf])
      kprop = kcounts / len(pareto_tail_indices) * 100
      df_k = pd.DataFrame(
          dict(_=["(good)", "(ok)", "(bad)", "(very bad)"], Count=kcounts, Pct=kprop)
      ).rename(index={0: "(-Inf, 0.5]", 1: " (0.5, 0.7]", 2: "   (0.7, 1]", 3: "   (1, Inf)"})
  
      if np.sum(kcounts[1:]) == 0:
          warnings.warn("All Pareto k estimates are good (k < 0.5)")
      elif np.sum(kcounts[2:]) == 0:
          warnings.warn("All Pareto k estimates are ok (k < 0.7)")
  
      return df_k
docs: Display a summary of Pareto tail indices.
  
      Parameters
      ----------
      pareto_tail_indices : array
        Pareto tail indices.
  
      Returns
      -------
      df_k : dataframe
        Dataframe containing k diagnostic values.