def MakeHists(live):
 hist = thinkstats2.Hist(live.birthwgt_lb, label='birthwgt_lb')
 thinkplot.Hist(hist)
 thinkplot.Save(root='first_wgt_lb_hist', xlabel='pounds', ylabel='frequency', axis=[(-1), 14, 0, 3200])
 hist = thinkstats2.Hist(live.birthwgt_oz, label='birthwgt_oz')
 thinkplot.Hist(hist)
 thinkplot.Save(root='first_wgt_oz_hist', xlabel='ounces', ylabel='frequency', axis=[(-1), 16, 0, 1200])
 hist = thinkstats2.Hist(np.floor(live.agepreg), label='agepreg')
 thinkplot.Hist(hist)
 thinkplot.Save(root='first_agepreg_hist', xlabel='years', ylabel='frequency')
 hist = thinkstats2.Hist(live.prglngth, label='prglngth')
 thinkplot.Hist(hist)
 thinkplot.Save(root='first_prglngth_hist', xlabel='weeks', ylabel='frequency', axis=[(-1), 53, 0, 5000])

def MakeHists ( live ) : hist = thinkstats2 . Hist ( live . birthwgt_lb , label = 'birthwgt_lb' ) thinkplot . Hist ( hist ) thinkplot . Save ( root = 'first_wgt_lb_hist' , xlabel = 'pounds' , ylabel = 'frequency' , axis = [ ( - 1 ) , 14 , 0 , 3200 ] ) hist = thinkstats2 . Hist ( live . birthwgt_oz , label = 'birthwgt_oz' ) thinkplot . Hist ( hist ) thinkplot . Save ( root = 'first_wgt_oz_hist' , xlabel = 'ounces' , ylabel = 'frequency' , axis = [ ( - 1 ) , 16 , 0 , 1200 ] ) hist = thinkstats2 . Hist ( np . floor ( live . agepreg ) , label = 'agepreg' ) thinkplot . Hist ( hist ) thinkplot . Save ( root = 'first_agepreg_hist' , xlabel = 'years' , ylabel = 'frequency' ) hist = thinkstats2 . Hist ( live . prglngth , label = 'prglngth' ) thinkplot . Hist ( hist ) thinkplot . Save ( root = 'first_prglngth_hist' , xlabel = 'weeks' , ylabel = 'frequency' , axis = [ ( - 1 ) , 53 , 0 , 5000 ] )
plot hists for live births live: dataframe others: dataframe .