eelbrain.Var.diff
- Var.diff(to_end=None, to_begin=None, name=None)
The differences between consecutive values
- Parameters
to_end (scalar (optional)) – Append
to_end
at the end.to_begin (scalar (optional)) – Add
to_begin
at the beginning.name (str) – Name of the output (default is the current name).
- Returns
diff – Difference.
- Return type
Examples
>>> v = Var([1, 2, 4]) >>> v.diff() Var([1, 2]) >>> v.diff(to_begin=-1) Var([-1, 1, 2])