pynapple.core.ts_group.TsGroup.__init__#

TsGroup.__init__(data, time_support=None, time_units='s', bypass_check=False, **kwargs)[source]#

TsGroup Initializer.

Parameters:
  • data (dict or iterable) – Dictionary or iterable of Ts/Tsd objects. The keys should be integer-convertible; if a non-dict iterator is passed, its values will be used to create a dict with integer keys.

  • time_support (IntervalSet, optional) – The time support of the TsGroup. Ts/Tsd objects will be restricted to the time support if passed. If no time support is specified, TsGroup will merge time supports from all the Ts/Tsd objects in data.

  • time_units (str, optional) – Time units if data does not contain Ts/Tsd objects (‘us’, ‘ms’, ‘s’ [default]).

  • bypass_check (bool, optional) – To avoid checking that each element is within time_support. Useful to speed up initialization of TsGroup when Ts/Tsd objects have already been restricted beforehand

  • **kwargs – Meta-info about the Ts/Tsd objects. Can be either pandas.Series, numpy.ndarray, list or tuple Note that the index should match the index of the input dictionary if pandas Series

Raises:
  • RuntimeError – Raise error if the union of time support of Ts/Tsd object is empty.

  • ValueError

    • If a key cannot be converted to integer. - If a key was a floating point with non-negligible decimal part. - If the converted keys are not unique, i.e. {1: ts_2, “2”: ts_2} is valid, {1: ts_2, “1”: ts_2} is invalid.