title: Update Value in one column, if string in other column contains something in list
body: <pre><code>  id name             gender
  0 13 John Smith       0
  1 46 Jim Jeffries     2
  2 75 Jennifer Johnson 0
  3 37 Sam Adams        0
  4 24 John Cleese      0
  5 17 Taika Waititi    0
  </code></pre>
  
  <p>I have a lot of people's names and genders in a df, taken from a film actors' db. Genders were assigned a 1 (female), 2 (male), or 0 (not listed). I'd like to comb through and callously assume genders by name. Names would be stored in a list, and filled out manually. Perhaps I spot somebody with a gender-nonspecific name by ID and find out myself if they are male/female, I'd like to inject that as well:</p>
  
  <pre><code>m_names = ['John', ...]
  f_names = ['Jennifer', ...]
  m_ids   = ['37', ...]
  f_ids   = ['', ...]
  </code></pre>
  
  <p>I've got fine control of for loops and np.where, but I can't figure out how to get through this df, row by row.</p>
  
  <p>If what's above were to be used, what I want to return would look like:</p>
  
  <pre><code>for index, row in df.iterrows():
    if row['gender'] == 0:
      if   row['name'].str.contains(' |'.join(f_names)) or row['id'].str.contains('|'.join(f_ids)):
        return 1
      elif row['name'].str.contains(' |'.join(m_names)) or row['id'].str.contains('|'.join(m_ids)):
        return 2
  print(df)
  
    id name             gender
  0 13 John Smith       2
  1 46 Jim Jeffries     2
  2 75 Jennifer Johnson 1
  3 37 Sam Adams        2
  4 24 John Cleese      2
  5 17 Taika Waititi    0
  </code></pre>
  
  <p>Note the space before '|' in the condition for names, to avoid grabbing any parts of last names.</p>
  
  <p>At this point, I'm running into a wall with how I've formatted my if statements. Python doesn't like my formatting, and says my 'return's are 'outside function'. If I change these to</p>
  
  <pre><code>row['gender'] = #
  </code></pre>
  
  <p>I run into issues with unicode and my usage of 'str' and 'contains'.</p>