sktime.utils.validation.series

sktime.utils.validation.series.check_equal_time_index(*ys)[source]

Check that time series have the same (time) indices.

Parameters

ys (pd.Series or pd.DataFrame) – One or more time series

Raises

ValueError – If (time) indices are not the same

sktime.utils.validation.series.check_series(Z, enforce_univariate=False, allow_empty=False, allow_numpy=True, enforce_index_type=None)[source]

Validate input data.

Parameters
  • Z (pd.Series, pd.DataFrame) – Univariate or multivariate time series

  • enforce_univariate (bool, optional (default=False)) – If True, multivariate Z will raise an error.

  • allow_empty (bool) – If False, empty Z will raise an error

  • enforce_index_type (type, optional (default=None)) – type of time index

Returns

Z – Validated time series

Return type

pd.Series, pd.DataFrame

Raises

ValueError, TypeError – If Z is an invalid input

sktime.utils.validation.series.check_time_index(index, allow_empty=False, enforce_index_type=None)[source]

Check time index.

Parameters
  • index (pd.Index or np.array) – Time index

  • allow_empty (bool, optional (default=False)) – If False, empty index raises an error.

  • enforce_index_type (type, optional (default=None)) – type of time index

Returns

time_index – Validated time index

Return type

pd.Index