def boxcox(x, lmbda=None, alpha=None):
 x = np.asarray(x)
 if (x.size == 0):
  return x
 if any((x <= 0)):
  raise ValueError('Data must be positive.')
 if (lmbda is not None):
  return special.boxcox(x, lmbda)
 lmax = boxcox_normmax(x, method='mle')
 y = boxcox(x, lmax)
 if (alpha is None):
  return (y, lmax)
 else:
  interval = _boxcox_conf_interval(x, lmax, alpha)
  return (y, lmax, interval)

def boxcox ( x , lmbda = None , alpha = None ) : x = np . asarray ( x ) if ( x . size == 0 ) : return x if any ( ( x <= 0 ) ) : raise ValueError ( 'Data must be positive.' ) if ( lmbda is not None ) : return special . boxcox ( x , lmbda ) lmax = boxcox_normmax ( x , method = 'mle' ) y = boxcox ( x , lmax ) if ( alpha is None ) : return ( y , lmax ) else : interval = _boxcox_conf_interval ( x , lmax , alpha ) return ( y , lmax , interval )
return a positive dataset transformed by a box-cox power transformation .