def CohenEffectSize(group1, group2):
 diff = (group1.mean() - group2.mean())
 (n1, n2) = (len(group1), len(group2))
 var1 = group1.var()
 var2 = group2.var()
 pooled_var = (((n1 * var1) + (n2 * var2)) / (n1 + n2))
 d = (diff / math.sqrt(pooled_var))
 return d

def CohenEffectSize ( group1 , group2 ) : diff = ( group1 . mean ( ) - group2 . mean ( ) ) ( n1 , n2 ) = ( len ( group1 ) , len ( group2 ) ) var1 = group1 . var ( ) var2 = group2 . var ( ) pooled_var = ( ( ( n1 * var1 ) + ( n2 * var2 ) ) / ( n1 + n2 ) ) d = ( diff / math . sqrt ( pooled_var ) ) return d
compute cohens d .