File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -766,11 +766,12 @@ def impute_missing_values(data):
766766 """
767767 impute_values = \\ \n + {"var1": 0, "var2": "", "var3": 125.3}
768768 """
769- self .score_code += f"\n \n { '' :4} # Specify downcasting behavior for pandas 2.x to avoid warnings\n "
770- self .score_code += f"{ '' :4} if int(pd.__version__.split('.')[0]) == 2:\n { '' :8} pd.set_option('future.no_silent_downcasting', True)\n "
771- self .score_code += f"{ '' :4} return data.replace(r'^\\ s*\\ .$', np.nan, regex=True).fillna(impute_values).infer_objects()\n "
772- """
773-
769+ self .score_code += (
770+ f"\n \n { '' :4} # Specify downcasting behavior for pandas 2.x to avoid warnings\n " +
771+ f"{ '' :4} if int(pd.__version__.split('.')[0]) == 2:\n { '' :8} pd.set_option('future.no_silent_downcasting', True)\n " +
772+ f"{ '' :4} return data.replace(r'^\\ s*\\ .$', np.nan, regex=True).fillna(impute_values).infer_objects()\n "
773+ )
774+ """
774775 # Specify downcasting behavior for pandas 2.x to avoid warnings
775776 if int(pd.__version__.split('.')[0]) == 2:
776777 pd.set_option('future.no_silent_downcasting', True)
You can’t perform that action at this time.
0 commit comments