def Summarize(live, firsts, others):
 mean = live.prglngth.mean()
 var = live.prglngth.var()
 std = live.prglngth.std()
 print('Live mean', mean)
 print('Live variance', var)
 print('Live std', std)
 mean1 = firsts.prglngth.mean()
 mean2 = others.prglngth.mean()
 var1 = firsts.prglngth.var()
 var2 = others.prglngth.var()
 print('Mean')
 print('First babies', mean1)
 print('Others', mean2)
 print('Variance')
 print('First babies', var1)
 print('Others', var2)
 print('Difference in weeks', (mean1 - mean2))
 print('Difference in hours', (((mean1 - mean2) * 7) * 24))
 print('Difference relative to 39 weeks', (((mean1 - mean2) / 39) * 100))
 d = thinkstats2.CohenEffectSize(firsts.prglngth, others.prglngth)
 print('Cohen d', d)

def Summarize ( live , firsts , others ) : mean = live . prglngth . mean ( ) var = live . prglngth . var ( ) std = live . prglngth . std ( ) print ( 'Live mean' , mean ) print ( 'Live variance' , var ) print ( 'Live std' , std ) mean1 = firsts . prglngth . mean ( ) mean2 = others . prglngth . mean ( ) var1 = firsts . prglngth . var ( ) var2 = others . prglngth . var ( ) print ( 'Mean' ) print ( 'First babies' , mean1 ) print ( 'Others' , mean2 ) print ( 'Variance' ) print ( 'First babies' , var1 ) print ( 'Others' , var2 ) print ( 'Difference in weeks' , ( mean1 - mean2 ) ) print ( 'Difference in hours' , ( ( ( mean1 - mean2 ) * 7 ) * 24 ) ) print ( 'Difference relative to 39 weeks' , ( ( ( mean1 - mean2 ) / 39 ) * 100 ) ) d = thinkstats2 . CohenEffectSize ( firsts . prglngth , others . prglngth ) print ( 'Cohen d' , d )
print various summary statistics .