Skip to content

Commit

Permalink
DOC Clarify fill_value behavior in SimpleImputer (#25081)
Browse files Browse the repository at this point in the history
Fixes #12306
  • Loading branch information
thomasjpfan authored and glemaitre committed Dec 21, 2022
1 parent f6ecd3d commit 1e9bddf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sklearn/impute/_base.py
Expand Up @@ -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
Expand Down

0 comments on commit 1e9bddf

Please sign in to comment.