title: Pandas: Calculate average of values for a time frame
body: <p>I am working on a large datasets that looks like this:</p>
  
  <pre><code>Time,   Value
  01.01.2018 00:00:00.000,  5.1398
  01.01.2018 00:01:00.000,  5.1298
  01.01.2018 00:02:00.000,  5.1438
  01.01.2018 00:03:00.000,  5.1228
  01.01.2018 00:04:00.000,  5.1168
  .... , ,,,,
  31.12.2018 23:59:59.000,  6.3498
  </code></pre>
  
  <p>The data is a <code>minute</code> data from the <code>first</code> day of the year to the <code>last</code> day of the year</p>
  
  <p>I want to use <code>Pandas</code> to find the average of every <code>5</code> days. </p>
  
  <p>For example:</p>
  
  <p>Average from <code>01.01.2018 00:00:00.000</code> to <code>05.01.2018 23:59:59.000</code> is average for <code>05.01.2018</code></p>
  
  <p>The next average will be from <code>02.01.2018 00:00:00.000</code> to <code>6.01.2018 23:59:59.000</code> is average for <code>06.01.2018</code></p>
  
  <p>The next average will be from <code>03.01.2018 00:00:00.000</code> to <code>7.01.2018 23:59:59.000</code> is average for <code>07.01.2018</code></p>
  
  <p>and so on... We are incrementing day by 1 but calculating an average from the day to past 5days, including the current date.</p>
  
  <blockquote>
    <p>For a given day, there are 24hours * 60minutes =  1440 data points. So I need to get the average of 1440 data points * 5 days = 7200 data points.</p>
  </blockquote>
  
  <p>The final DataFrame will look like this, time format [DD.MM.YYYY] (without hh:mm:ss) and the <code>Value</code> is the average of 5 data including the current date:</p>
  
  <pre><code>Time,   Value
  05.01.2018,  5.1398
  06.01.2018,  5.1298
  07.01.2018,  5.1438
  .... , ,,,,
  31.12.2018,  6.3498
  </code></pre>
  
  <p>The bottom line is to calculate the average of data from today to the past 5 days and the average value is shown as above.</p>
  
  <p>I tried to iterate through Python loop but I wanted something better than we can do from Pandas.</p>