pastas.timeseries.validate_oseries#

pastas.timeseries.validate_oseries(series: pandas.Series, verbose: bool = False) bool#

Method to validate user-provided oseries input time series.

Parameters:
  • series (pandas.Series) – Pandas.Series object containing the series time series.

  • verbose (bool, optional) – Whether to print the results of the checks in the validation process.

Returns:

True if the series is valid. If not, an error is raised.

Return type:

bool

Notes

The Series are validated for the following cases:

  1. Make sure the series is a Pandas.Series

  2. Make sure the values are floats

  3. Make sure the index is a DatetimeIndex

  4. Make sure the indices are datetime64 (and tz naive)

  5. Make sure the index has no NaT-values

  6. Make sure the index is monotonically increasing

  7. Make sure there are no duplicate indices

  8. Detect if the time series has nan-values (filled with fill_nan TimeSeries’ settings)

If any of these checks are not passed the method will throw an error that needs to be fixed by the user.

Examples

>>> ps.validate_oseries(series)