pastas.timeseries.TimeSeries.update_series#

pastas.timeseries.TimeSeries.update_series(force_update: bool = False, **kwargs) None#

Method to update the series with new options.

Parameters:
  • force_update (bool, optional) – argument that is used to force an update, even when no changes are found. Internally used by the __init__ method. Default is False.

  • freq (str, optional) – String representing the desired frequency of the time series. Must be one of the following: (D, h, m, s, ms, us, ns) or a multiple of that e.g. “7D”.

  • sample_up (str or float, optional) – String with the method to use when the frequency is increased (e.g., Weekly to daily). Possible values are: “backfill”, “bfill”, “pad”, “ffill”, “mean”, “interpolate”, “divide” or a float value to fill the gaps.

  • sample_down (str, optional) – String with the method to use when the frequency decreases (e.g., from daily to weekly values). Possible values are: “mean”, “drop”, “sum”, “min”, “max”.

  • fill_nan (str or float, optional) – Method to use when there ar nan-values in the time series. Possible values are: “mean”, “drop”, “interpolate” (default) or a float value.

  • fill_before (str or float, optional) – Method used to extend a time series before any measurements are available. possible values are: “mean” or a float value.

  • fill_after (str or float, optional) – Method used to extend a time series after any measurements are available. Possible values are: “mean” or a float value.

  • tmin (pandas.Timestamp or str, optional) – A string or pandas.Timestamp with the minimum time of the series (E.g. ‘1980-01-01 00:00:00’).

  • tmax (pandas.Timestamp or str, optional) –

    A string or pandas.Timestamp with the maximum time of the series (E.g. ‘2020-01-01 00:00:00’). Strings are converted to

    pandas.Timestamp internally.

Notes

The method will validate if any of the settings is changed to determine if the series need to be updated.