def CleanFemPreg(df):
 df.agepreg /= 100.0
 df.birthwgt_lb[(df.birthwgt_lb > 20)] = np.nan
 na_vals = [97, 98, 99]
 df.birthwgt_lb.replace(na_vals, np.nan, inplace=True)
 df.birthwgt_oz.replace(na_vals, np.nan, inplace=True)
 df.hpagelb.replace(na_vals, np.nan, inplace=True)
 df.babysex.replace([7, 9], np.nan, inplace=True)
 df.nbrnaliv.replace([9], np.nan, inplace=True)
 df['totalwgt_lb'] = (df.birthwgt_lb + (df.birthwgt_oz / 16.0))
 df.cmintvw = np.nan

def CleanFemPreg ( df ) : df . agepreg /= 100.0 df . birthwgt_lb [ ( df . birthwgt_lb > 20 ) ] = np . nan na_vals = [ 97 , 98 , 99 ] df . birthwgt_lb . replace ( na_vals , np . nan , inplace = True ) df . birthwgt_oz . replace ( na_vals , np . nan , inplace = True ) df . hpagelb . replace ( na_vals , np . nan , inplace = True ) df . babysex . replace ( [ 7 , 9 ] , np . nan , inplace = True ) df . nbrnaliv . replace ( [ 9 ] , np . nan , inplace = True ) df [ 'totalwgt_lb' ] = ( df . birthwgt_lb + ( df . birthwgt_oz / 16.0 ) ) df . cmintvw = np . nan
recodes variables from the pregnancy frame .