spmviz.data.find_occurrence#
- spmviz.data.find_occurrence(sequence, pattern, constraints=None, times=None, start=0, **kw)[source]#
Element indices of the earliest-ending occurrence of a pattern, or
None.- Parameters:
- sequencesequence
ofitemsets - pattern
pattern - constraints
Constraints,optional Or the keywords
min_gap,max_gap,max_span,gap_unit.- timessequence
offloat,optional Timestamps of the elements, required when
gap_unit="time".- start
int First element index that may be matched.
- sequencesequence
Examples
>>> find_occurrence(["a", "b", "x", "c"], "a c") [0, 3] >>> find_occurrence(["a", "b", "x", "c"], "a c", max_gap=2) is None True