pastas.timeseries_utils.get_sample#
- pastas.timeseries_utils.get_sample(tindex: pandas.Index, ref_tindex: pandas.Index) pandas.Index#
Sample the index of a pandas Series or DataFrame so that the frequency is not higher than the frequency of ref_tindex.
- Parameters:
tindex (pandas.DatetimeIndex) – The original Index, consisting of pandas Timestamps.
ref_tindex (pandas.DatetimeIndex) – A reference Index consisting of pandas Timestamps.
- Returns:
The sampled index, consisting of a subset of the original index tindex. The values in tindex that are closest to ref_index are returned.
- Return type:
Notes
Find the index closest to the ref_tindex, and then return a selection of the index.