File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -538,9 +538,16 @@ def make_continuous(
538538 columns = _validate_skip_only (data , skip , only )
539539
540540 # Convert dtype, ignoring errors
541- data .loc [:, columns ] = data .loc [:, columns ].apply (
542- lambda col : pd .to_numeric (col , errors = "ignore" )
543- )
541+ # data.loc[:, columns] = data.loc[:, columns].apply(
542+ # lambda col: pd.to_numeric(col, errors="ignore")
543+ # )
544+ def try_convert (col ):
545+ try :
546+ return pd .to_numeric (col )
547+ except Exception :
548+ return col
549+
550+ data .loc [:, columns ] = data .loc [:, columns ].apply (try_convert )
544551
545552 # Check if any variables could not be converted
546553 failed_conversion = data .loc [:, columns ].dtypes .apply (
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " clarite"
3- version = " 2.4.1 "
3+ version = " 2.4.2 "
44description = " CLeaning to Analysis: Reproducibility-based Interface for Traits and Exposures"
55authors = [" Andre Rico <andreluis.rico@pennmedicine.upenn.edu>" ]
66license = " BSD-3-Clause"
You can’t perform that action at this time.
0 commit comments