normalize_values_in_dictΒΆ
Normalize the values in a dictionary using the given factor.
For each element in the dictionary, applies value/factor
.
ParametersΒΆ
-
dictionary
Dictionary to normalize.
-
factor β defaults to
None
Normalization factor value. If not set, use the sum of values.
-
inplace β defaults to
True
If True, perform operation in-place
-
raise_error β defaults to
False
In case the normalization factor is either
0
orNone
:
-True
: raise an error. -False
: return gracefully (ifinplace=False
, a copy of)dictionary
.