kappa_sdk.apply_factor#

kappa_sdk.apply_factor(vector, value)[source]#

Applies a scaling factor to the values of a vector.

This function takes a Vector object and a value, scaling each element in the vector’s values by the given value. It preserves the original dates and first_x attribute from the input vector object while returning the adjusted vector.

Parameters:
  • vector (Vector) – The vector object whose values are to be scaled. It contains dates and a list of numerical values.

  • value (float) – The scaling factor by which to multiply each value in the vector.

Returns:

Vector – A new Vector object with the adjusted values and the original dates and first_x attributes preserved.

Return type:

Vector