Skip to content

Pattern: PChanged

Outputs a 1 if the value of the input pattern has changed,

or 0 otherwise.

Example output

>>> a = PSequence([1, 0, 1, 2, 2, 2, 1, 0, 0, 1], repeats=1)
>>> b = PChanged(a)
>>> b.all()
[1, 1, 1, 0, 0, 1, 1, 0, 1]