From eff4e5e8c6520105122db35bfd5ff952b99ef9de Mon Sep 17 00:00:00 2001 From: "Thomas J. Fan" Date: Wed, 30 Nov 2022 14:22:22 -0500 Subject: [PATCH] DOC Clarify fill_value in SimpleImputer --- sklearn/impute/_base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sklearn/impute/_base.py b/sklearn/impute/_base.py index e186640f1e812..ab92e839718df 100644 --- a/sklearn/impute/_base.py +++ b/sklearn/impute/_base.py @@ -176,9 +176,10 @@ class SimpleImputer(_BaseImputer): strategy="constant" for fixed value imputation. fill_value : str or numerical value, default=None - When strategy == "constant", fill_value is used to replace all - occurrences of missing_values. - If left to the default, fill_value will be 0 when imputing numerical + When strategy == "constant", `fill_value` is used to replace all + occurrences of missing_values. For string or object data types, + `fill_value` must be a string. + If `None`, `fill_value` will be 0 when imputing numerical data and "missing_value" for strings or object data types. verbose : int, default=0