title: in pandas how can I groupby weekday() for a datetime column?
body: <p>I'd like to filter out weekend data and only look at data for weekdays (mon(0)-fri(4)).  I'm new to pandas, what's the best way to accomplish this in pandas?</p>
  
  <pre><code>import datetime
  from pandas import *
  
  data = read_csv("data.csv")
  data.my_dt 
  
  Out[52]:
  0     2012-10-01 02:00:39
  1     2012-10-01 02:00:38
  2     2012-10-01 02:01:05
  3     2012-10-01 02:01:07
  4     2012-10-01 02:02:03
  5     2012-10-01 02:02:09
  6     2012-10-01 02:02:03
  7     2012-10-01 02:02:35
  8     2012-10-01 02:02:33
  9     2012-10-01 02:03:01
  10    2012-10-01 02:08:53
  11    2012-10-01 02:09:04
  12    2012-10-01 02:09:09
  13    2012-10-01 02:10:20
  14    2012-10-01 02:10:45
  ...
  </code></pre>
  
  <p>I'd like to do something like:</p>
  
  <pre><code>weekdays_only = data[data.my_dt.weekday() &lt; 5]
  </code></pre>
  
  <p>AttributeError: 'numpy.int64' object has no attribute 'weekday'</p>
  
  <p>but this doesn't work, I haven't quite grasped how column datetime objects are accessed.</p>
  
  <p>The eventual goal being to arrange hierarchically to weekday hour-range, something like:</p>
  
  <pre><code>monday, 0-6, 7-12, 13-18, 19-23
  tuesday, 0-6, 7-12, 13-18, 19-23
  </code></pre>