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
spec_source_col:str
specimen source 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( SPECIMEN_SOURCE_SITE=tf.specimen_source_site(spec_source_col='SpecimenSource') ))# here's a table of the resultshelpers.gt_style(df_inp=df)