foundryts.functions.skip_nonfinite

foundryts.functions.skip_nonfinite()

Returns a function that filters all points with non-finite values in a time series.

Non-finite values can be inf or NaN.

  • Returns: A function that accepts a single time series and returns the filtered time series with only finite point values.
  • Return type: (FunctionNode) -> FunctionNode

Dataframe schema

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

This function is only applicable to numeric series.

See Also

where()

Examples

Copied!
1>>> series = F.points( 2... (100, 100.0), 3... (120, float("nan")), 4... (130, 230.0), 5... (166, float("inf")), 6... (167, 366.0), 7... (168, float("-inf")), 8... name="series", 9... ) 10>>> series.to_pandas() 11 timestamp value 120 1970-01-01 00:00:00.000000100 100.0 131 1970-01-01 00:00:00.000000120 NaN 142 1970-01-01 00:00:00.000000130 230.0 153 1970-01-01 00:00:00.000000166 inf 164 1970-01-01 00:00:00.000000167 366.0 175 1970-01-01 00:00:00.000000168 -inf
Copied!
1>>> finite_series = F.skip_nonfinite()(series) 2>>> finite_series.to_pandas() 3 timestamp value 40 1970-01-01 00:00:00.000000100 100.0 51 1970-01-01 00:00:00.000000130 230.0 62 1970-01-01 00:00:00.000000167 366.0