title_dict = {'male': 'mr.', 'female': 'ms.'}
table['title'] = map(lambda title, gender: title if title != None else
    title_dict[gender], table['title'], table['gender'])
Apply function to each row of pandas dataframe to create two new columns