diff label_encoder.py @ 41:d769d83ec796 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 9981e25b00de29ed881b2229a173a8c812ded9bb
author bgruening
date Wed, 09 Aug 2023 13:14:12 +0000
parents e76f6dfea5c9
children
line wrap: on
line diff
--- a/label_encoder.py	Thu Aug 11 08:53:29 2022 +0000
+++ b/label_encoder.py	Wed Aug 09 13:14:12 2023 +0000
@@ -21,24 +21,24 @@
         File path to output vector
 
     """
-    warnings.simplefilter('ignore')
+    warnings.simplefilter("ignore")
 
-    with open(inputs, 'r') as param_handler:
+    with open(inputs, "r") as param_handler:
         params = json.load(param_handler)
 
-    input_header = params['header0']
-    header = 'infer' if input_header else None
+    input_header = params["header0"]
+    header = "infer" if input_header else None
 
-    input_vector = pd.read_csv(infile, sep='\t', header=header)
+    input_vector = pd.read_csv(infile, sep="\t", header=header)
 
     le = LabelEncoder()
 
     output_vector = le.fit_transform(input_vector)
 
-    np.savetxt(outfile, output_vector, fmt="%d", delimiter='\t')
+    np.savetxt(outfile, output_vector, fmt="%d", delimiter="\t")
 
 
-if __name__ == '__main__':
+if __name__ == "__main__":
     aparser = argparse.ArgumentParser()
     aparser.add_argument("-i", "--inputs", dest="inputs", required=True)
     aparser.add_argument("-y", "--infile", dest="infile")