title: loop over rows in pandas
body: <p>Im using python, and i have some difficulties to loop over rows in python.
  my dataframe contains 3 columns : id, val1, size.
  i want to create column col1 based on size.
  Il trying this code and my code is never inside the first condition . How should i correct it please. Let's say that i don't won't something working with other method, im trying just to cirrect my own code.</p>
  <p>Friendly,</p>
  <p><strong>Sample of data</strong></p>
  <pre><code>data = [['x1', 100, 1], ['x2', 200, 2], ['x3', 300, 1]]
  df = pd.DataFrame(data, columns = ['id', 'val1', 'size'])
  </code></pre>
  <p><strong>code</strong></p>
  <pre><code>if (df['size'] == 2) is True:
    df['col1'] = df['val1']
    print(&quot;1&quot;)
  else:
    pass
  </code></pre>