neuralib.signal.segement

class neuralib.signal.segement.Segment[source]

DEPRECATED.Segment container class

__init__(data, copy=True)[source]
Parameters:
  • data (Segment | np.ndarray)

  • copy (bool)

classmethod from_logical(y, x=None, interpolate=False)[source]

Construct Segment from logical vector

Parameters:
  • y (np.ndarray) – 1d logical array Any sequence of True values that is flanked by False values is converted into a segment

  • x (np.ndarray | None) – 1d array like, optional The segment indices from y will be used to index into x

  • interpolate – bool, optional if true, segments of duration 0 are extent to have a minimal duration

Return type:

Segment

property start: ndarray

Get/Set vector of segment start values

property stop: ndarray
neuralib.signal.segement.check_segments(x, copy=False)[source]

DEPRECATED. Convert to segment array.

Parameters:
  • x (ndarray) – 1d array-like or (n,2) array-like

  • copy – the output will always be a copy of the input

Returns:

(n,2) array

Return type:

ndarray