title: Groupby a column value for 2 hour
body: <p>I have a data frame with columns Date, Time, Distance. I want to groupby distance column for each day with 2 hours interval. I have checked the question asked in stack overflow, but it is not giving me the required output. </p>
  
  <p>The sample code I have pasted is from stack overflow, but the output is not as desired.</p>
  
  <pre><code>uniquedate = np.unique(df2["Date"])
  for i in uniquedate:
      data_new1 = df2[df2['Date']==i]
      data_new2 = data_new1[['Real_time', 'Distance_km']].copy()
      data_new2.index = pd.to_timedelta(data_new2.index.astype(str))
      data_new2 = data_new2.resample('2H').sum()
      print(data_new2)
  
                   Distance_km
  00:00:00.000000   276.850844
                   Distance_km
  00:00:00.000000   193.115217
  </code></pre>
  
  <p>I got this output but this is not as required</p>