timeatlas.time_series_dataset.TimeSeriesDataset.resample

TimeSeriesDataset.resample(freq: Union[str, timeatlas.time_series.time_series.TimeSeries], method: Optional[str] = None) → timeatlas.time_series_dataset.time_series_dataset.TimeSeriesDataset

Convert the TimeSeries in a TimeSeriesDataset to a specified frequency. Optionally provide filling method to pad/backfill missing values.

Parameters
  • freq

    str or TimeSeries. The new time difference between two adjacent entries in the returned TimeSeries.

    If a TimeSeries is given, the freq in self will become the same as in the given TimeSeries.

    If a string is given, three options are available:
    • ’lowest’ : to sync the TimeSeriesDataset to the lowest frequency

    • ’highest’ : to sync the TimeSeriesDataset to the highest frequency

    • A DateOffset alias e.g.: 15min, H, etc.

  • method

    {‘backfill’/’bfill’, ‘pad’/’ffill’}, default None Method to use for filling holes in reindexed Series (note this does not fill NaNs that already were present):

    • ’pad’/’ffil’: propagate last valid observation forward to next valid

    • ’backfill’/’ffill’: use next valid observation to fill

Returns

TimeSeriesDataset