Mercurial > repos > bgruening > sklearn_to_categorical
diff label_encoder.py @ 5:b650955a20cc draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 9981e25b00de29ed881b2229a173a8c812ded9bb
author | bgruening |
---|---|
date | Wed, 09 Aug 2023 13:04:21 +0000 |
parents | f93f0cdbaf18 |
children |
line wrap: on
line diff
--- a/label_encoder.py Thu Aug 11 09:45:22 2022 +0000 +++ b/label_encoder.py Wed Aug 09 13:04:21 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")