How to avoid slow for(): loops, when using Pandas dataframe?
<pre><code>for i in range( 1, len( df ) ):
    if df.loc[i]["identification"] == df.loc[i-1]["identification"] and df.loc[i]["date"] == df.loc[i-1]["date"]:
       df.loc[i,"duplicate"] = 1
    else:
       df.loc[i,"duplicate"] = 0
</code></pre>

<p>This simple for loop runs really slow when processing a dataframe of a big size.</p>

<p>Any suggestions?</p>