You are viewing an older version (2.4.3). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.4.3 / numpy / ma / extras / ediff1d

function

numpy.ma.extras:ediff1d

source: /numpy/ma/extras.py :1229

Signature

def   ediff1d ( arr to_end = None to_begin = None )

Summary

Compute the differences between consecutive elements of an array.

Extended Summary

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

Examples

import numpy as np
arr = np.ma.array([1, 2, 4, 7, 0])
np.ma.ediff1d(arr)

See also

numpy.ediff1d

Equivalent function for ndarrays.

Aliases

  • numpy.ma.ediff1d