def tvar(a, limits=None, inclusive=(True, True), axis=0, ddof=1):
 a = asarray(a)
 a = a.astype(float).ravel()
 if (limits is None):
  n = len(a)
  return ((a.var() * n) / (n - 1.0))
 am = _mask_to_limits(a, limits, inclusive)
 return np.ma.var(am, ddof=ddof, axis=axis)

def tvar ( a , limits = None , inclusive = ( True , True ) , axis = 0 , ddof = 1 ) : a = asarray ( a ) a = a . astype ( float ) . ravel ( ) if ( limits is None ) : n = len ( a ) return ( ( a . var ( ) * n ) / ( n - 1.0 ) ) am = _mask_to_limits ( a , limits , inclusive ) return np . ma . var ( am , ddof = ddof , axis = axis )
compute the trimmed variance this function computes the sample variance of an array of values .