title: Extracting the hour from a time column in pandas
body: <p>Suppose I have the following dataset: </p>
  
  <p><a href="https://i.stack.imgur.com/5GORt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5GORt.png" alt="enter image description here"></a></p>
  
  <p>How would I create a new column, to be the hour of the time?</p>
  
  <p>For example, the code below works for individual times, but I haven't been able to generalise it for a column in pandas.</p>
  
  <pre><code>t = datetime.strptime('9:33:07','%H:%M:%S')
  print(t.hour)
  </code></pre>