def METHOD_NAME(
    self, time_column: str, groupby: Optional[Union[List[str], str]] = None
) -> None:
    """
    Detect the time interval which is highly periodic.
    Runs PeriodogramPollingDetector._detect_polling_arr on the time_column and populates a
    p_value column, dominant_frequency column and dominant_interval column.
    If groupby column(s) are given then PeriodogramPollingDetector._detect_polling_arr is ran on
    each group.
    Parameters
    ----------
    time_column: str
        The name of the column that contains timestamps
    groupby: str or list[str], optional
        Column(s) to group by
    """
    ts_col = self.data[time_column]
    start = min(ts_col)
    end = max(ts_col)
    if not groupby:
        p_value, freq, interval = self._detect_polling_arr(ts_col, start, end)
        self.data["p_value"] = p_value
        self.data["dominant_frequency"] = freq
        self.data["dominant_interval"] = interval
    else:
        grouped_results = self.data.groupby(groupby).apply(
            lambda x: self._detect_polling_arr(
                x[time_column], min(x[time_column]), max(x[time_column])
            )
        )
        grouped_results_df = pd.DataFrame(
            grouped_results.tolist(),
            columns=["p_value", "dominant_frequency", "dominant_interval"],
            index=grouped_results.index,
        ).reset_index()
        self.data = self.data.merge(grouped_results_df)