title: Pandas: Timing difference between Function and Apply to Series
body: <p>I am trying to figure out why these two methods differ in <code>%timeit</code> results. </p>
  
  <pre><code>import pandas as pd
  import numpy as np
  d = pd.DataFrame(data={'S1' : [2,3,4,5,6,7,2], 'S2' : [4,5,2,3,4,6,8]}, \
                   index=[1,2,3,4,5,6,7])
  
  %timeit pd.rolling_mean(d, window=3, center=True)
  10000 loops, best of 3: 182 µs per loop
  
  %timeit d.apply(lambda x: pd.rolling_mean(x, window=3, center=True))
  1000 loops, best of 3: 695 µs per loop
  </code></pre>
  
  <p>Why is the apply(lambda) method ~3.5 x slower. In more complex dataframes, I have noticed a larger difference (~10 x). </p>
  
  <p>Does the lambda method create a copy of the data in this operation?</p>