ktk.TimeSeries.get_event_index#

TimeSeries.get_event_index(name, occurrence=0)[source]#

Get the events index of a given occurrence of an event name.

Warning

The function get_event_index is deprecated since 0.10.0 and is scheduled to be removed in 2024.

This function was deprecated in an attempt to simplify the TimeSeries API. A similar way to achieve the same result would be to do:

temp = ts.sort_events()
indexes = [i for i, e in enumerate(temp.events) if e.name == name]
index = indexes[occurrence]
Parameters
  • name (str) –

  • occurrence (int) –

Return type

int