diff label_encoder.py @ 10:b3093f953091 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 9981e25b00de29ed881b2229a173a8c812ded9bb
author bgruening
date Wed, 09 Aug 2023 13:30:51 +0000
parents ead8f1822587
children
line wrap: on
line diff
--- a/label_encoder.py	Thu Aug 11 09:15:54 2022 +0000
+++ b/label_encoder.py	Wed Aug 09 13:30:51 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")