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 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 >>> series = F.points( ... (100, 100.0), ... (120, float("nan")), ... (130, 230.0), ... (166, float("inf")), ... (167, 366.0), ... (168, float("-inf")), ... name="series", ... ) >>> series.to_pandas() timestamp value 0 1970-01-01 00:00:00.000000100 100.0 1 1970-01-01 00:00:00.000000120 NaN 2 1970-01-01 00:00:00.000000130 230.0 3 1970-01-01 00:00:00.000000166 inf 4 1970-01-01 00:00:00.000000167 366.0 5 1970-01-01 00:00:00.000000168 -inf
Copied!
1 2 3 4 5 6 >>> finite_series = F.skip_nonfinite()(series) >>> finite_series.to_pandas() timestamp value 0 1970-01-01 00:00:00.000000100 100.0 1 1970-01-01 00:00:00.000000130 230.0 2 1970-01-01 00:00:00.000000167 366.0