pymovements.utils.filters.filter_candidates_remove_nans#

pymovements.utils.filters.filter_candidates_remove_nans(candidates: list[ndarray], values: ndarray) list[ndarray][source]#

Filters a list of candidates for an event-detection algorithm

Removes leading and ending np.nans for all candidates in candidates

Parameters:
  • candidates (list, list of candidates) – List of candidates; each candidate consists of a list of indices

  • values (array-like, shape (N, 1) or shape (N, 2)) – Corresponding continuous 1D/2D values time series.

Returns:

a filtered list of candidates

Return type:

list