title: How to iterate through a csv file and update value based on the value of another
body: <p>I have a csv file with one column with the header 'size' that is blank for each value of the csv file. I have three values of size, 1, 2, and 3. I want to update this empty column with the corresponding value of another variable 'time'. I want rows with a 'time' value between 0-100 to have a size of 1, rows with a 'time' value between 101-200 to be 2, and for the rest to be 3. I have attached the data and some code I have tried. Thank you so much!
  <a href="https://i.stack.imgur.com/6dWvJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6dWvJ.png" alt="enter image description here" /></a></p>
  <pre><code>for row in data.iterrows():
      if data['time']&lt;=100:
          data['size']=1
      elif 100&lt;data['time']&lt;200:
          data['size']=2
      else:
          data['size']='3'
  </code></pre>
  <p>But that gives me <code>'ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().'</code></p>