pastas.timeseries_utils.get_sample_for_freq#
- pastas.timeseries_utils.get_sample_for_freq(series: pandas.Series | pandas.DataFrame | None = None, freq: str | None = None, tmin: pandas.Timestamp | str | None = None, tmax: pandas.Timestamp | str | None = None, **kwargs)#
Sample a pandas Series or DataFrame so that the frequency is not higher than a supplied frequency.
- Parameters:
series (pandas.Series or pandas.DataFrame) – The original Series or DataFrame to be sampled.
freq (str) – A frequency string accepted by pandas.date_range().
tmin (pandas.Timestamp or str, optional) – The start date of the sampled series. If None, the tmin is set to the first index of series. The default is None.
tmax (pandas.Timestamp or str, optional) – The end date of the sampled series. If None, the tmax is set to the last index of series. The default is None.
- Returns:
The sampled series, consisting of a subset of the original series.
- Return type: