dask 2021.10.0

NotesParametersReturnsBackRef
ediff1d(ary, to_end=None, to_begin=None)

This docstring was copied from numpy.ediff1d.

Some inconsistencies with the Dask version may exist.

Notes

When applied to masked arrays, this function drops the mask information if the :None:None:`to_begin` and/or :None:None:`to_end` parameters are used.

Parameters

ary : array_like

If necessary, will be flattened before the differences are taken.

to_end : array_like, optional

Number(s) to append at the end of the returned differences.

to_begin : array_like, optional

Number(s) to prepend at the beginning of the returned differences.

Returns

ediff1d : ndarray

The differences. Loosely, this is ary.flat[1:] - ary.flat[:-1] .

The differences between consecutive elements of an array.

See Also

diff
gradient

Examples

This example is valid syntax, but we were not able to check execution
>>> x = np.array([1, 2, 4, 7, 0])  # doctest: +SKIP
... np.ediff1d(x) # doctest: +SKIP array([ 1, 2, 3, -7])
This example is valid syntax, but we were not able to check execution
>>> np.ediff1d(x, to_begin=-99, to_end=np.array([88, 99]))  # doctest: +SKIP
array([-99,   1,   2, ...,  -7,  88,  99])

The returned array is always 1D.

This example is valid syntax, but we were not able to check execution
>>> y = [[1, 2, 4], [1, 6, 24]]  # doctest: +SKIP
... np.ediff1d(y) # doctest: +SKIP array([ 1, 2, -3, 5, 18])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

dask.array.routines.diff

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/array/routines.py#575
type: <class 'function'>
Commit: