wildboar.utils.variable_len
#
Utilities for variable length series.
Module Contents#
Functions#
Return the length of each time-series. |
|
Test element-wise for EoS and return result as a boolean array. |
|
Test if time-series is variable length. |
- wildboar.utils.variable_len.get_variable_length(x)[source]#
Return the length of each time-series.
- Parameters:
- xtime-series
The input.
- Returns:
- float or ndarray
The lenght of the time series.
Examples
>>> from wildboar.utils.variable_len import get_variable_length >>> x = np.array( ... [ ... [[1, 2, 3, eos], [1, 2, eos, eos], [1, 2, 3, 4]], ... [[1, 2, 3, eos], [1, 2, eos, eos], [1, eos, 3, 4]], ... ] ... ) >>> get_variable_length(x) [[3 2 4] [3 2 4]]
>>> get_variable_length([1, 2, eos, eos]) 2
>>> get_variable_length([[1, 2, eos, eos]]) [2]