interpreTS.utils package#

Submodules#

interpreTS.utils.data_conversion module#

interpreTS.utils.data_conversion.convert_to_time_series(data)#

Convert input data to a TimeSeriesData object.

Parameters#

datapd.DataFrame, pd.Series, or np.ndarray

The data to be converted into a TimeSeriesData object.

Returns#

TimeSeriesData

An instance of TimeSeriesData wrapping the input data.

Raises#

TypeError

If the input data is not of type pd.DataFrame, pd.Series, or np.ndarray.

Examples#

>>> import pandas as pd
>>> data = pd.Series([1, 2, 3, 4, 5])
>>> ts_data = convert_to_time_series(data)

interpreTS.utils.data_validation module#

interpreTS.utils.data_validation.validate_time_series_data(data, require_datetime_index=False)#

Validate if the input data is suitable for time series processing.

Parameters#

datapd.Series, pd.DataFrame, or np.ndarray

The time series data to be validated.

require_datetime_indexbool, optional

If True, validation will ensure the data has a DateTime index (for time-based operations).

Returns#

bool

True if the data is valid; raises an error otherwise.

Raises#

TypeError

If data is not a pd.Series, pd.DataFrame, or np.ndarray.

ValueError

If the data contains NaN values or lacks a DateTime index when required.

Module contents#