def preprocess(infile, outfile, separator, encoding, drop_columns): """ Preprocess device files """ loader = BaseLoader() loader.preprocess(infile, outfile, encoding=encoding, sep=separator, drop_columns=drop_columns)
def preprocess(ctx, infile, outfile): ndc_loader = BaseLoader() # xforms performs transformations on the column names. # If the value is callable, call it on the column value (key) # Otherwise, just replace with the given value. xforms = { "Type": "te_type", "drug_id": "ind_drug_id", "status": "ind_status", "phase": "ind_phase", } ndc_loader.preprocess(infile, outfile, column_xforms=xforms) print(outfile)