parameters: (ary, to_end=None, to_begin=None)
return_statement: return ed
docstring: The differences between consecutive elements of an array.
  
      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
      -------
      ed : ndarray
          The differences. Loosely, this is ``ary.flat[1:] - ary.flat[:-1]``.
  
      See Also
      --------
      diff, gradient
  
      Notes
      -----
      When applied to masked arrays, this function drops the mask information
      if the `to_begin` and/or `to_end` parameters are used.
  
      Examples
      --------
      >>> x = np.array([1, 2, 4, 7, 0])
      >>> np.ediff1d(x)
      array([ 1,  2,  3, -7])
  
      >>> np.ediff1d(x, to_begin=-99, to_end=np.array([88, 99]))
      array([-99,   1,   2,   3,  -7,  88,  99])
  
      The returned array is always 1D.
  
      >>> y = [[1, 2, 4], [1, 6, 24]]
      >>> np.ediff1d(y)
      array([ 1,  2, -3,  5, 18])
docstring_summary: The differences between consecutive elements of an array.
docstring_tokens: The differences between consecutive elements of an array .
function: def ediff1d(ary, to_end=None, to_begin=None):
      """
      The differences between consecutive elements of an array.
  
      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
      -------
      ed : ndarray
          The differences. Loosely, this is ``ary.flat[1:] - ary.flat[:-1]``.
  
      See Also
      --------
      diff, gradient
  
      Notes
      -----
      When applied to masked arrays, this function drops the mask information
      if the `to_begin` and/or `to_end` parameters are used.
  
      Examples
      --------
      >>> x = np.array([1, 2, 4, 7, 0])
      >>> np.ediff1d(x)
      array([ 1,  2,  3, -7])
  
      >>> np.ediff1d(x, to_begin=-99, to_end=np.array([88, 99]))
      array([-99,   1,   2,   3,  -7,  88,  99])
  
      The returned array is always 1D.
  
      >>> y = [[1, 2, 4], [1, 6, 24]]
      >>> np.ediff1d(y)
      array([ 1,  2, -3,  5, 18])
  
      """
      ary = np.asanyarray(ary).flat
      ed = ary[1:] - ary[:-1]
      arrays = [ed]
      if to_begin is not None:
          arrays.insert(0, to_begin)
      if to_end is not None:
          arrays.append(to_end)
  
      if len(arrays) != 1:
          # We'll save ourselves a copy of a potentially large array in
          # the common case where neither to_begin or to_end was given.
          ed = np.hstack(arrays)
  
      return ed
function_tokens: def ediff1d ( ary , to_end = None , to_begin = None ) : ary = np . asanyarray ( ary ) . flat ed = ary [ 1 : ] - ary [ : - 1 ] arrays = [ ed ] if to_begin is not None : arrays . insert ( 0 , to_begin ) if to_end is not None : arrays . append ( to_end ) if len ( arrays ) != 1 : # We'll save ourselves a copy of a potentially large array in # the common case where neither to_begin or to_end was given. ed = np . hstack ( arrays ) return ed