Skip to main content
`Ctrl`+`K`

# numpy.ma.ediff1d

ma.ediff1d(arr, to_end=None, to_begin=None)

  Compute the differences between consecutive elements of an array.

  This function is the equivalent of `numpy.ediff1d` that takes masked values into account, see `numpy.ediff1d` for details.

  See also

  `numpy.ediff1d`

    Equivalent function for ndarrays.

  Examples

      >>> import numpy as np
      >>> arr = np.ma.array([1, 2, 4, 7, 0])
      >>> np.ma.ediff1d(arr)
      masked_array(data=[ 1,  2,  3, -7],
                   mask=False,
             fill_value=999999)