eelbrain.NDVar.diff
- NDVar.diff(dim=None, n=1, pad=True, name=None)
Discrete difference (see
numpy.diff())- Parameters:
dim (str) – Dimension along which to operate.
n (int) – Number of times to difference (default 1).
pad (bool) – Pad the
dimdimension of the result to conserve NDVar shape (default). For exmaple,diff([0, 1, 1, 0]) -> [0, 1, 0, -1].name (str) – Name of the output NDVar (default is the current name).
- Returns:
NDVar with the
nth differences. If the input is masked, the previous mask is extended bynto mask all values indiffthat incorporate previsouly masked values.- Return type: