title: Add time interval values in new column Pandas
body: <p>I  have a large pandas dataframe (40 million rows) with the following format :</p>
  
  <pre><code>ID                    DATETIME             TIMESTAMP
  81215545953683710540  2017-01-01 17:39:57  1483243205
  74994612102903447699  2017-01-01 19:14:12  1483243261
  48126186377367976994  2017-01-01 17:19:29  1483243263
  23522333658893375671  2017-01-01 12:50:46  1483243266
  16194691060240380504  2017-01-01 15:59:23  1483243353
  </code></pre>
  
  <p>I am trying to assign a value to each row depending on the timestamp so that i have group of rows with the same value if they are in the same time interval.</p>
  
  <p>Let's say I have <code>t0 = 1483243205</code> and I want a differently value when <code>TIMESTAMP = t0+10</code> . So here my time interval would be of 10.</p>
  
  <p>I would like something like that :</p>
  
  <pre><code>ID                    DATETIME             TIMESTAMP  VALUE 
  81215545953683710540  2017-01-01 17:39:57  1483243205 0
  74994612102903447699  2017-01-01 19:14:12  1483243261 5
  48126186377367976994  2017-01-01 17:19:29  1483243263 5
  23522333658893375671  2017-01-01 12:50:46  1483243266 6
  16194691060240380504  2017-01-01 15:59:23  1483243288 8
  </code></pre>
  
  <p>Here is my code :</p>
  
  <pre><code>df['VALUE']=''
  t=1483243205
  j=0
  
  for i in range(0,len(df['TIMESTAMP'])):
      while(df.iloc[i][2])&lt;(t+10):
          df['VALUE'][i]=j
          i+=1  
      t+=10
      j+=1
  </code></pre>
  
  <p>I have a warning when executing my code (SettingWithCopyWarning: 
  A value is trying to be set on a copy of a slice from a DataFrame) and I have the following result :</p>
  
  <pre><code>ID                    DATETIME             TIMESTAMP  VALUE 
  81215545953683710540  2017-01-01 17:39:57  1483243205 0
  74994612102903447699  2017-01-01 19:14:12  1483243261
  48126186377367976994  2017-01-01 17:19:29  1483243263
  23522333658893375671  2017-01-01 12:50:46  1483243266
  16194691060240380504  2017-01-01 15:59:23  1483243288
  </code></pre>
  
  <p>It is not the first time I encounter the warning and I always overcame it, but I am confused with the fact I only got a value for the first row.</p>
  
  <p>Does anyone know what I am missing ?</p>
  
  <p>Thanks</p>