transform()
Transform a list of values by applying a scaling factor.
Usage
transform(
data,
scale=1.0,
)Each element in the input list is multiplied by the scale factor to produce the output list.
Parameters
data: list-
A list of numeric values to transform.
scale: float = 1.0-
The scaling factor to apply. Defaults to
1.0.
Returns
list-
A new list with each element scaled.
Notes
The transformation is applied element-wise. The original list is not modified.
Examples
>>> transform([1, 2, 3], scale=2.0)
[2.0, 4.0, 6.0]>>> transform([10, 20], scale=0.5)
[5.0, 10.0]