title: Pandas: Rounding to nearest Hour
body: <p>I have a column with timestamps</p>
  
  <pre><code> start_time: 
   0    2016-06-04 05:18:49
   1    2016-06-04 06:50:12
   2    2016-06-04 08:16:02
   3    2016-06-04 15:05:13
   4    2016-06-04 15:24:25
  </code></pre>
  
  <p>I want use a function on the start_time column to round minutes >= 30 to the next hour.</p>
  
  <pre><code> def extract_time(col):
        time = col.strftime('%H:%M')
        min= int(time.strip(':')[1])
        hour= int(time.strip(':')[0])
        if min &gt;= 30:
             return hour + 1
        return hour
  </code></pre>
  
  <p>Then I want to create a new columns 'hour', with the rounded hours:</p>
  
  <pre><code> df['hour'] = df['start_time'].apply(extract_time)
  </code></pre>
  
  <p>Instead of getting getting an 'hour' column with the rounded hours, I am getting the below:</p>
  
  <pre><code> 0    &lt;function extract_hour at 0x128722b90&gt;
   1    &lt;function extract_hour at 0x128722b90&gt;
   2    &lt;function extract_hour at 0x128722b90&gt;
   3    &lt;function extract_hour at 0x128722b90&gt;
   4    &lt;function extract_hour at 0x128722b90&gt;
  </code></pre>