diff label_encoder.py @ 40:5af054432771 draft

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