title: Pandas rolling window function offsets data
body: <p>I am attempting to use the Pandas rolling_window function, with win_type = 'gaussian' or win_type = 'general_gaussian'. I have a time-series dataset, indexed by datetime, and I need a smoothing function to reduce noise. I would like to avoid the boxcar, and instead use a Gaussian weighting. I have experimented with many ranges of window size and std (for gaussian), and window size, power, and width values (for general Gaussian), and I consistently get the same result: the smoothed output is offset lower than the original input data. This is the same issue that was asked but remains unanswered <a href="https://stackoverflow.com/questions/21332896/pandas-rolling-window-appears-to-introduce-offset-to-rolled-data/27204561#27204561">here</a>.</p>
  
  <p>The specific line of code I am trying to use for this is:</p>
  
  <pre><code>dNorth_smooth = rolling_window(s, window=40, win_type='gaussian', std=30, center=True, freq='15S')
  </code></pre>
  
  <p>Where 's' is a single column of data in a datetime-indexed Pandas dataframe. In this case, 's' is position in meters, at 15 second time intervals. So, my window size is 40 lines, or 40*15 = 600 sec = 10 min. It is not clear what exactly the std argument refers to, but I assume this is in the frequency domain, and would be some value smaller than the window size, controlling the shape of the Gaussian curve (regardless, I have experimented with many std values; if std is very large, then no offset occurs, but this is because the Gaussian curve becomes so wide compared to the window, that you are essentially using a boxcar). The 'center' and 'freq' arguments do not appear to change output either way. Other optional arguments also seem irrelevant.</p>
  
  <p>Once I have higher reputation I can post a plot to help explain. But see the plot at the linked question above, as this is the exact same problem I have. Also to note: the boxcar window (which is equivalent to rolling_mean) does <em>not</em> have this offset problem. It does, however, seem to exist with all other window weighting functions (triang, blackman, etc).</p>