xdas.diff#

xdas.diff(da, dim, n=1, *, label='upper')[source]#

Calculate the n-th order discrete difference along given axis.

Parameters:
  • da (DataArray) – Input data.

  • dim (str, optional) – Dimension over which to calculate the finite difference.

  • n (int, default: 1) – The number of times values are differentiated.

  • label ({"upper", "lower"}, default: "upper") – The new coordinate in dimension dim will have the values of either the minuend’s or subtrahend’s coordinate for values ‘upper’ and ‘lower’, respectively.

Returns:

difference – The n-th order finite difference of this object.

Return type:

DataArray