+
K
Returns a function that filters all points with non-finite values in a time series.
Non-finite values can be inf or NaN.
inf
NaN
FunctionNode
This function is only applicable to numeric series.
where()
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
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
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