old_contents: import sys
  sys.path.insert(1, "../../")
  import h2o
  
  def impute(ip,port):
      # Connect to a pre-existing cluster
      h2o.init(ip,port)
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      prostate.dim()
  
      #print "Summary of the data in iris_missing.csv"
      #print "Each column has 50 missing observations (at random)"
      #prostate.summary()
  
      #print "Make a copy of the original dataset to play with."
  
      print "Impute a numeric column with the mean"
      nas = prostate["DPROS"].isna().sum()
      print "NAs before imputation: {0}".format(nas)
      h2o.impute(prostate, "DPROS", method = "mean")
  
      nas = prostate["DPROS"].isna().sum()
      print "NAs after imputation: {0}".format(nas)
  
      # OTHER POSSIBLE SYNTAXES ALLOWED:
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, 8, method = "mean")
  
      #prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      #h2o.impute(prostate, ["VOL"], method = "mean")
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, "VOL", method = "mean")
  
      # USING  MEDIAN
      print "Impute a numeric column with the median"
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, "VOL", method = "median")
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, 8, method = "median")
  
      #prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      #h2o.impute(prostate, ["VOL"], method = "median")
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, "VOL", method = "median")
  
  if __name__ == "__main__":
      h2o.run_test(sys.argv, impute)
new_contents: import sys
  sys.path.insert(1, "../../")
  import h2o
  
  def impute(ip,port):
      # Connect to a pre-existing cluster
      h2o.init(ip,port)
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      prostate.dim()
  
      #print "Summary of the data in iris_missing.csv"
      #print "Each column has 50 missing observations (at random)"
      #prostate.summary()
  
      #print "Make a copy of the original dataset to play with."
  
      print "Impute a numeric column with the mean"
      nas = prostate["DPROS"].isna().sum()
      print "NAs before imputation: {0}".format(nas)
      h2o.impute(prostate, "DPROS", method = "mean")
  
      nas = prostate["DPROS"].isna().sum()
      print "NAs after imputation: {0}".format(nas)
  
      # OTHER POSSIBLE SYNTAXES ALLOWED:
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, 8, method = "mean")
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, ["VOL"], method = "mean")
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, "VOL", method = "mean")
  
      # USING  MEDIAN
      print "Impute a numeric column with the median"
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, "VOL", method = "median")
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, 8, method = "median")
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, ["VOL"], method = "median")
  
      prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
      h2o.impute(prostate, "VOL", method = "median")
  
  if __name__ == "__main__":
      h2o.run_test(sys.argv, impute)
subject: allow column parameter to be list of one column, so uncommented pyunit