code: private String pythonify(String n) {
      if (n == null || name.toLowerCase().contains("confusion")) return n;
      StringBuilder sb = new StringBuilder();
      String [] modified = n.split("[\\s_]+");
      for (int i=0; i<modified.length; ++i) {
        if (i!=0) sb.append("_");
        String s = modified[i];
  //      if (!s.matches("^[A-Z]{2,3}$")) {
          sb.append(s.toLowerCase()); //everything goes lowercase
  //      } else {
  //        sb.append(s);
  //      }
      }
      String newString = sb.toString().replaceAll("[^\\w]", "");
  //    if (!newString.equals(name)) {
  //      Log.warn("Turning column description into field name: " + name + " --> " + newString);
  //    }
      return newString;
    }
docs: Turn a description such as "Avg. Training MSE" into a JSON-usable field name "avg_training_mse"
  @param n
  @return