title: Python Pandas DataFrame: KeyError 0 while iterating through the DataFrame after using the set_index and resample methods
body: <p>After using the pandas set_index method and resampling the 15min dataframe to 1min dataframe I was trying to iterate through the dataframe- so the one with the 1min data time indexes. However, I got the <strong>&quot;KeyError: 0&quot;.</strong></p>
  <p>I just tried the following simple code lines but it does not work:</p>
  <pre><code>for i in range(df.size):
      print(df[i,&quot;value&quot;])
  
  </code></pre>
  <p>I tried also this one:</p>
  <pre><code>for i in range(len(df)):
      print(df[i,&quot;value&quot;])
  
  </code></pre>
  <p>I noticed that this error only occurs when I use the set.index and the resampling method. The iteration works for the same dataframe before resampling.</p>