rdtools.filtering.two_way_window_filter

rdtools.filtering.two_way_window_filter(series, roll_period=Timedelta('7 days 00:00:00'), outlier_threshold=0.03)

Removes anomalies based on forward and backward window of the rolling median. Points beyond outlier_threshold from both the forward and backward-looking median are excluded by the filter. Designed for use after the aggregation step in the RdTools trend analysis workflows.

Parameters:
  • series (pandas.Series) -- Pandas time series to be filtered.

  • roll_period (int or timedelta, default 7 days) -- The window to use for backward and forward rolling medians for detecting outliers.

  • outlier_threshold (default is 0.03 meaning 3%)

Returns:

Boolean Series excluding anomalies

Return type:

pandas.Series