title: Second to_replace to dataframe is not updating dataframe in Python
body: <p>I am replacing values of an existing dataframe in Python during a <code>for loop</code>.  My original dataframe is of this format:</p>
  <p><a href="https://i.stack.imgur.com/qyySn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qyySn.png" alt="enter image description here" /></a></p>
  <p>After trying to update the items in the &quot;slice_file_name&quot; and &quot;fsID&quot; via these pandas replace commands:</p>
  <pre><code>df1['slice_file_name'] = df1['slice_file_name'].replace(to_replace=str(row[&quot;slice_file_name&quot;]),value=f'{actual_filename}_{directory}.wav')
  
  fsID_Name = str(row[&quot;fsID&quot;])
  
  df1['fsID'] = df1['fsID'].replace(to_replace=str(row[&quot;fsID&quot;]), value=f'{fsID_Name}_{directory}')
  </code></pre>
  <p>Only the &quot;slice_file_name&quot; gets updated correctly:</p>
  <p><a href="https://i.stack.imgur.com/fc3Ww.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fc3Ww.png" alt="enter image description here" /></a></p>
  <p>The &quot;fsID&quot; does not get updated correctly.  Can you tell me what I am doing wrong here?</p>
  <p>I want to update the &quot;fsID&quot; column as follows: - for example for the first data row, &quot;fsID&quot; should be equal to 102305_TimeShift-10pct.  I see from my ide that <code>f'{fsID_Name}_{directory}'</code> gives the correct string, but it is not updating the fsID cell.  How to update the fsID cell accordingly?</p>
  <p>Thanks!</p>