foundryts.functions.where

foundryts.functions.where(true=None, false=None)

(DEPRECATED) Returns a function that transforms non-zero and zero values with the specified functions for truthy and falsey values, respectively.

  • Parameters:
    • true (FunctionNode | int | float, optional) – Function or value to transform the non-zero values using (default is None leaving non-zero values unchanged).
    • false (FunctionNode | int | float, optional) – Function or value to transform the zero values using (default is None leaving zero values unchanged).
  • Returns: A function that accepts a single time series and transforms non-zero and zero values with the specified functions for truthy and falsey values, respectively.
  • Return type: (FunctionNode) -> FunctionNode

Dataframe schema

Column nameTypeDescription
timestamppandas.TimestampTimestamp of the point
valuefloatValue of the point
Note

This function is Deprecated and will be removed in a future release.

Examples

Copied!
1 2 3 4 5 6 7 8 9 10 11 >>> series = F.points( ... (1, 1.0), ... (2, 0.0), ... (3, 0.0), ... name="series", ... ) >>> series.to_pandas() timestamp value 0 1970-01-01 00:00:00.000000001 1.0 1 1970-01-01 00:00:00.000000002 0.0 2 1970-01-01 00:00:00.000000003 0.0
Copied!
1 2 3 4 5 6 >>> transformed_series = F.where(true=series * 2, false=-1)(series) >>> transformed_series.to_pandas() timestamp value 0 1970-01-01 00:00:00.000000001 2.0 1 1970-01-01 00:00:00.000000002 -1.0 2 1970-01-01 00:00:00.000000003 -1.0