tslearn.utils.check_equal_size

tslearn.utils.check_equal_size(dataset)[source]

Check if all time series in the dataset have the same size.

Parameters:
dataset: array-like

The dataset to check.

Returns:
bool

Whether all time series in the dataset have the same size.

Examples

>>> check_equal_size([[1, 2, 3], [4, 5, 6], [5, 3, 2]])
True
>>> check_equal_size([[1, 2, 3, 4], [4, 5, 6], [5, 3, 2]])
False