View source on GitHub |
Infers frequency and makes an irregular time series regular.
tfp.substrates.numpy.sts.regularize_series(
series,
frequency=None,
warn_missing_tolerance=None,
err_missing_tolerance=None,
max_series_length=None
)
Converts a time series into a regular time series having the same period between successive time points (e.g. 5 seconds, or 1 day). If the frequency is known, it can be supplied through the 'frequency' argument; otherwise it will be inferred.
If multiple values share the same timestamp, they are summed into a single value.
Args | |
---|---|
series
|
a Pandas pd.Series instance indexed by a pd.DateTimeIndex . This
may also be a single-column pd.DataFrame .
|
frequency
|
a Pandas DateOffset object, e.g. pd.DateOffset(seconds=1) . If
no frequency is specified, and the index of series does not have a
frequency populated, the granularity of the time series will be inferred
automatically.
Default value: None .
|
warn_missing_tolerance
|
optional instance of
tfp.sts.MissingValuesTolerance , specifying warning thresholds for
too many missing values.
Default value: None . (do not warn).
|
err_missing_tolerance
|
optional instance of
tfp.sts.MissingValuesTolerance , specifying error thresholds for
too many missing values.
Default value: None . (do not raise errors).
|
max_series_length
|
int maximum length of the regularized
series (note that regularization may increase the length of the series).
Used to bound the resources used per invocation.
Default value: None .
|