check_window_length¶
- check_window_length(window_length: int | float | Timedelta | timedelta | timedelta64 | DateOffset, n_timepoints: int | None = None, name: str = 'window_length') int | Timedelta | timedelta | timedelta64 | DateOffset[source]¶
Validate window length.
- Parameters:
- window_length: positive int, positive float in (0, 1), positive timedelta,
positive pd.DateOffset, or None The window length: - If int, the total number of time points. - If float, the fraction of time points relative to n_timepoints. - If timedelta, length in corresponding time units - If pd.DateOffset, length in corresponding time units following calendar rules
- n_timepoints: positive int, default=None
The number of time points to which to apply window_length when passed as a float (fraction). Will be ignored if window_length is an integer.
- name: str
Name of argument for error messages.
- Returns:
- window_length: int or timedelta or pd.DateOffset