how to compare two columns in pandas to make a third column ? : <p>i have two columns age and sex in a pandas dataframe </p>

<pre><code>sex = ['m', 'f' , 'm', 'f', 'f', 'f', 'f']
age = [16 ,  15 , 14 , 9  , 8   , 2   , 56 ]
</code></pre>

<p>now i want to extract a third column : like this 
if age &lt;=9 then output ' child' and if age >9 then output the respective gender </p>

<pre><code>sex = ['m', 'f'  , 'm','f'    ,'f'    ,'f'    , 'f']
age = [16 ,  15  , 14 , 9     , 8     , 2     , 56 ]
yes = ['m', 'f'  ,'m' ,'child','child','child','f' ]
</code></pre>

<p>please help 
ps . i am still working on it if i get anything  i will immediately update  </p>
