title: Iteratively change every cell in a column of a Pandas dataframe
body: <p>I am trying to change the value of every cell in a Pandas data frame.  Expecting <code>.loc</code> to allow me to identify a cell with the paradigm <code>df.loc[row_index, column_name] = cell value</code>, I've used the following loop:</p>
  
  <pre><code>table["field"] = 6 #placehodler value used only to create the column
  for field, index in enumerate(table["field"]):   table.loc[index,
  "field"] = table.loc[index, "field_x"] if math.isnan(table.loc[index,
  "field_y"]) else table.loc[index, "field_y"]
  </code></pre>
  
  <p>However, I'm getting the following error: <code>KeyError: 'the label [6] is not in the [index]'</code>.  What is the correct syntax for selecting values by index?</p>