def normaltest(a, axis=0, nan_policy='propagate'):
 (a, axis) = _chk_asarray(a, 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.normaltest(a, axis)
 (s, _) = skewtest(a, axis)
 (k, _) = kurtosistest(a, axis)
 k2 = ((s * s) + (k * k))
 return NormaltestResult(k2, distributions.chi2.sf(k2, 2))

def normaltest ( a , axis = 0 , nan_policy = 'propagate' ) : ( a , axis ) = _chk_asarray ( a , 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 . normaltest ( a , axis ) ( s , _ ) = skewtest ( a , axis ) ( k , _ ) = kurtosistest ( a , axis ) k2 = ( ( s * s ) + ( k * k ) ) return NormaltestResult ( k2 , distributions . chi2 . sf ( k2 , 2 ) )
tests whether a sample differs from a normal distribution .