title: Update row values where certain condition is met in pandas
body: <p>Say I have the following dataframe:</p>
  
  <p><a href="https://i.stack.imgur.com/qD5f2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qD5f2.png" alt="table"></a></p>
  
  <p>What is the most efficient way to update the values of the columns <strong>feat</strong> and <strong>another_feat</strong> where the <strong>stream</strong> is number <strong>2</strong>?</p>
  
  <p>Is this it?</p>
  
  <pre><code>for index, row in df.iterrows():
      if df1.loc[index,'stream'] == 2:
         # do something
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  What to do if I have more than a 100 columns? I don't want to explicitly name the columns that I want to update. I want to divide the value of each column by 2 (except for the stream column).</p>
  
  <p>So to be clear what my goal is:</p>
  
  <p><strong>Dividing all values by 2 of all rows that have stream 2, but not changing the stream column</strong></p>