The function can be called into a .with_columns() statement. It will reference the dataframe’s status column and output a cleaned version of it.
Parameters
wdrs_spec_type_col:str
specimen type column
Examples
import polars as plimport wadoh_subtyping.transform as tffrom wadoh_raccoon.utils import helpersdf = pl.DataFrame({"submitter": ["PHL", "PHL", "PHL"],"SpecimenSource": ["Resipiratory: nasal swab","Nasopharyngeal Swab (NP)","Conjunctival Swab" ]})# here's how to apply the function to a dataframedf = ( df .with_columns( WDRS_SPECIMEN_TYPE=tf.wdrs_specimen_type(wdrs_spec_type_col='SpecimenSource') ))# here's a table of the resultshelpers.gt_style(df_inp=df)