parameters: (a, axis=0, bias=True, nan_policy='propagate')
return_statement: return vals
docstring: Compute the skewness of a data set.
  
      For normally distributed data, the skewness should be about 0. For
      unimodal continuous distributions, a skewness value > 0 means that
      there is more weight in the right tail of the distribution. The
      function `skewtest` can be used to determine if the skewness value
      is close enough to 0, statistically speaking.
  
      Parameters
      ----------
      a : ndarray
          data
      axis : int or None, optional
          Axis along which skewness is calculated. Default is 0.
          If None, compute over the whole array `a`.
      bias : bool, optional
          If False, then the calculations are corrected for statistical bias.
      nan_policy : {'propagate', 'raise', 'omit'}, optional
          Defines how to handle when input contains nan. 'propagate' returns nan,
          'raise' throws an error, 'omit' performs the calculations ignoring nan
          values. Default is 'propagate'.
  
      Returns
      -------
      skewness : ndarray
          The skewness of values along an axis, returning 0 where all values are
          equal.
  
      References
      ----------
  
      .. [1] Zwillinger, D. and Kokoska, S. (2000). CRC Standard
         Probability and Statistics Tables and Formulae. Chapman & Hall: New
         York. 2000.
         Section 2.2.24.1
  
      Examples
      --------
      >>> from scipy.stats import skew
      >>> skew([1, 2, 3, 4, 5])
      0.0
      >>> skew([2, 8, 0, 4, 1, 9, 9, 0])
      0.2650554122698573
docstring_summary: Compute the skewness of a data set.
docstring_tokens: Compute the skewness of a data set .
function: def skew(a, axis=0, bias=True, nan_policy='propagate'):
      """
      Compute the skewness of a data set.
  
      For normally distributed data, the skewness should be about 0. For
      unimodal continuous distributions, a skewness value > 0 means that
      there is more weight in the right tail of the distribution. The
      function `skewtest` can be used to determine if the skewness value
      is close enough to 0, statistically speaking.
  
      Parameters
      ----------
      a : ndarray
          data
      axis : int or None, optional
          Axis along which skewness is calculated. Default is 0.
          If None, compute over the whole array `a`.
      bias : bool, optional
          If False, then the calculations are corrected for statistical bias.
      nan_policy : {'propagate', 'raise', 'omit'}, optional
          Defines how to handle when input contains nan. 'propagate' returns nan,
          'raise' throws an error, 'omit' performs the calculations ignoring nan
          values. Default is 'propagate'.
  
      Returns
      -------
      skewness : ndarray
          The skewness of values along an axis, returning 0 where all values are
          equal.
  
      References
      ----------
  
      .. [1] Zwillinger, D. and Kokoska, S. (2000). CRC Standard
         Probability and Statistics Tables and Formulae. Chapman & Hall: New
         York. 2000.
         Section 2.2.24.1
  
      Examples
      --------
      >>> from scipy.stats import skew
      >>> skew([1, 2, 3, 4, 5])
      0.0
      >>> skew([2, 8, 0, 4, 1, 9, 9, 0])
      0.2650554122698573
      """
      a, axis = _chk_asarray(a, axis)
      n = a.shape[axis]
  
      contains_nan, nan_policy = _contains_nan(a, nan_policy)
  
      if contains_nan and nan_policy == 'omit':
          a = ma.masked_invalid(a)
          return mstats_basic.skew(a, axis, bias)
  
      m2 = moment(a, 2, axis)
      m3 = moment(a, 3, axis)
      zero = (m2 == 0)
      vals = _lazywhere(~zero, (m2, m3),
                        lambda m2, m3: m3 / m2**1.5,
                        0.)
      if not bias:
          can_correct = (n > 2) & (m2 > 0)
          if can_correct.any():
              m2 = np.extract(can_correct, m2)
              m3 = np.extract(can_correct, m3)
              nval = np.sqrt((n - 1.0) * n) / (n - 2.0) * m3 / m2**1.5
              np.place(vals, can_correct, nval)
  
      if vals.ndim == 0:
          return vals.item()
  
      return vals
function_tokens: def skew ( a , axis = 0 , bias = True , nan_policy = 'propagate' ) : a , axis = _chk_asarray ( a , axis ) n = a . shape [ axis ] contains_nan , nan_policy = _contains_nan ( a , nan_policy ) if contains_nan and nan_policy == 'omit' : a = ma . masked_invalid ( a ) return mstats_basic . skew ( a , axis , bias ) m2 = moment ( a , 2 , axis ) m3 = moment ( a , 3 , axis ) zero = ( m2 == 0 ) vals = _lazywhere ( ~ zero , ( m2 , m3 ) , lambda m2 , m3 : m3 / m2 ** 1.5 , 0. ) if not bias : can_correct = ( n > 2 ) & ( m2 > 0 ) if can_correct . any ( ) : m2 = np . extract ( can_correct , m2 ) m3 = np . extract ( can_correct , m3 ) nval = np . sqrt ( ( n - 1.0 ) * n ) / ( n - 2.0 ) * m3 / m2 ** 1.5 np . place ( vals , can_correct , nval ) if vals . ndim == 0 : return vals . item ( ) return vals