************************************* :py:mod:`wildboar.utils.variable_len` ************************************* .. py:module:: wildboar.utils.variable_len .. autoapi-nested-parse:: Utilities for variable length series. .. !! processed by numpydoc !! Module Contents --------------- Functions --------- .. autoapisummary:: wildboar.utils.variable_len.get_variable_length wildboar.utils.variable_len.is_end_of_series wildboar.utils.variable_len.is_variable_length .. py:function:: get_variable_length(x) Return the length of each time-series. :Parameters: **x** : time-series The input. :Returns: float or ndarray The lenght of the time series. .. rubric:: 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] .. !! processed by numpydoc !! .. py:function:: is_end_of_series(x) Test element-wise for EoS and return result as a boolean array. :Parameters: **x** : ndarray Input array. :Returns: ndarray Boolean indicator array. .. !! processed by numpydoc !! .. py:function:: is_variable_length(x) Test if time-series is variable length. :Parameters: **x** : time-series The input. :Returns: bool True if time series contains EoS. .. !! processed by numpydoc !!