parameters: (p, discont=pi, axis=-1)
return_statement: return up
docstring: Unwrap by changing deltas between values to 2*pi complement.
  
      Unwrap radian phase `p` by changing absolute jumps greater than
      `discont` to their 2*pi complement along the given axis.
  
      Parameters
      ----------
      p : array_like
          Input array.
      discont : float, optional
          Maximum discontinuity between values, default is ``pi``.
      axis : int, optional
          Axis along which unwrap will operate, default is the last axis.
  
      Returns
      -------
      out : ndarray
          Output array.
  
      See Also
      --------
      rad2deg, deg2rad
  
      Notes
      -----
      If the discontinuity in `p` is smaller than ``pi``, but larger than
      `discont`, no unwrapping is done because taking the 2*pi complement
      would only make the discontinuity larger.
  
      Examples
      --------
      >>> phase = np.linspace(0, np.pi, num=5)
      >>> phase[3:] += np.pi
      >>> phase
      array([ 0.        ,  0.78539816,  1.57079633,  5.49778714,  6.28318531])
      >>> np.unwrap(phase)
      array([ 0.        ,  0.78539816,  1.57079633, -0.78539816,  0.        ])
docstring_summary: Unwrap by changing deltas between values to 2*pi complement.
docstring_tokens: Unwrap by changing deltas between values to 2 * pi complement .
function: def unwrap(p, discont=pi, axis=-1):
      """
      Unwrap by changing deltas between values to 2*pi complement.
  
      Unwrap radian phase `p` by changing absolute jumps greater than
      `discont` to their 2*pi complement along the given axis.
  
      Parameters
      ----------
      p : array_like
          Input array.
      discont : float, optional
          Maximum discontinuity between values, default is ``pi``.
      axis : int, optional
          Axis along which unwrap will operate, default is the last axis.
  
      Returns
      -------
      out : ndarray
          Output array.
  
      See Also
      --------
      rad2deg, deg2rad
  
      Notes
      -----
      If the discontinuity in `p` is smaller than ``pi``, but larger than
      `discont`, no unwrapping is done because taking the 2*pi complement
      would only make the discontinuity larger.
  
      Examples
      --------
      >>> phase = np.linspace(0, np.pi, num=5)
      >>> phase[3:] += np.pi
      >>> phase
      array([ 0.        ,  0.78539816,  1.57079633,  5.49778714,  6.28318531])
      >>> np.unwrap(phase)
      array([ 0.        ,  0.78539816,  1.57079633, -0.78539816,  0.        ])
  
      """
      p = asarray(p)
      nd = len(p.shape)
      dd = diff(p, axis=axis)
      slice1 = [slice(None, None)]*nd     # full slices
      slice1[axis] = slice(1, None)
      ddmod = mod(dd+pi, 2*pi)-pi
      _nx.putmask(ddmod, (ddmod==-pi) & (dd > 0), pi)
      ph_correct = ddmod - dd;
      _nx.putmask(ph_correct, abs(dd)<discont, 0)
      up = array(p, copy=True, dtype='d')
      up[slice1] = p[slice1] + ph_correct.cumsum(axis)
      return up
function_tokens: def unwrap ( p , discont = pi , axis = - 1 ) : p = asarray ( p ) nd = len ( p . shape ) dd = diff ( p , axis = axis ) slice1 = [ slice ( None , None ) ] * nd # full slices slice1 [ axis ] = slice ( 1 , None ) ddmod = mod ( dd + pi , 2 * pi ) - pi _nx . putmask ( ddmod , ( ddmod == - pi ) & ( dd > 0 ) , pi ) ph_correct = ddmod - dd _nx . putmask ( ph_correct , abs ( dd ) < discont , 0 ) up = array ( p , copy = True , dtype = 'd' ) up [ slice1 ] = p [ slice1 ] + ph_correct . cumsum ( axis ) return up