title: Python - How to iterate through a dataframe and replace a value in one cell with a value from another in the same row
body: <p>I'm trying to create a new column in a dataframe of food ingredients with unique values per row based on information from other cells in the same row.</p>
  
  <p>The table essentially looks like this:</p>
  
  <pre><code>ingredient_name | ingredient_method | consolidated_name
  Cheese          | [camembert, pkg]  | 
  Cheese          | [cream, pastueri] |
  Egg             | [raw, scrambled]  |
  </code></pre>
  
  <p>I'm trying to iterate through the rows and fill the <code>consolidated_name</code> column with values from either <code>ingredient_name</code> or <code>ingredient_method</code>.<br>
  For example, if <code>ingredient_name</code> is "Cheese" I want that row's consolidated name to be the first element of the list in <code>ingredient_method</code>.</p>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>for i, row in df.iterrows():
      consolidated = df['ingredient_name']
      if (df['ingredient_name'] == 'Cheese').all():
          consolidated = df['ingredient_method'][0]
      df.set_value(i,'consolidated_name',consolidated)
  </code></pre>
  
  <p>The code runs without errors but none of the values change in the dataframe.<br>
  Any ideas?</p>