title: Why "rows["epic_week"] = epic_week" does not work?
body: <p>I try to add a new column to pandas data frame. When I want to update the by using iterrows() function, the &quot;rows[&quot;epic_week&quot;]  = epic_week&quot; does not work.</p>
  <pre><code>date_counter = 5
  pre_date = df.Date[0]
  epic_week = 9
  df[&quot;epic_week&quot;] = 0
  for index, rows in df.iterrows():
      if rows[&quot;Date&quot;] != pre_date:
          date_counter += 1
          pre_date = rows[&quot;Date&quot;]
          if date_counter &gt; 7:
              date_counter = 1
              epic_week += 1
          rows[&quot;epic_week&quot;] = epic_week
  </code></pre>