title: How to do Pandas dataframe.groupby(these_columns).apply(function for those_columns)?
body: <p>I have a pandas dataframe <code>df</code>:</p>
  
  <pre><code>&gt;&gt;&gt; df
                     net_inventory      sales    yr temp_stk_id
  STK_ID   RPT_Date                                            
  34_STK43 20080331       282.1603   359.4644  2008    34_STK43
           20080630       297.4760   716.7633  2008    34_STK43
           20080930       283.6312  1105.6332  2008    34_STK43
           20081231       296.9090  1380.4886  2008    34_STK43
           20090331       276.2348   363.3449  2009    34_STK43
           20090630       288.0186   753.6347  2009    34_STK43
           20090930       287.0811  1173.3760  2009    34_STK43
  
  
  &gt;&gt;&gt; df.dtypes
  net_inventory    float64
  sales            float64
  yr                object
  temp_stk_id       object
  </code></pre>
  
  <p>Then I want to do a "expanding_mean()" for "net_inventory" and "sales" columns, groupby  <code>['temp_stk_id','yr']</code>  :</p>
  
  <pre><code>&gt;&gt;&gt; df.groupby(['temp_stk_id','yr']).apply(lambda x: pd.expanding_mean(x))
  </code></pre>
  
  <p>It gives below error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "D:\Python\Lib\site-packages\pandas\core\groupby.py", line 322, in apply
      return self._python_apply_general(f)
    File "D:\Python\Lib\site-packages\pandas\core\groupby.py", line 325, in _python_apply_general
      keys, values, mutated = self.grouper.apply(f, self.obj, self.axis)
    File "D:\Python\Lib\site-packages\pandas\core\groupby.py", line 596, in apply
      res = f(group)
    File "D:\Python\Lib\site-packages\pandas\core\groupby.py", line 321, in &lt;lambda&gt;
      f = lambda g: func(g, *args, **kwargs)
    File "&lt;stdin&gt;", line 1, in &lt;lambda&gt;
    File "D:\Python\Lib\site-packages\pandas\stats\moments.py", line 697, in f
      time_rule=time_rule, **kwargs)
    File "D:\Python\Lib\site-packages\pandas\stats\moments.py", line 281, in _rolling_moment
      return_hook, values = _process_data_structure(arg)
    File "D:\Python\Lib\site-packages\pandas\stats\moments.py", line 326, in _process_data_structure
      values = values.astype(float)
  ValueError: invalid literal for float(): 34_STK43
  </code></pre>
  
  <p>I think it is because expanding_mean() not work for object type <code>temp_stk_id</code> and 'yr' column , so I want : </p>
  
  <pre><code>df.groupby(['temp_stk_id','yr']).apply(lambda x: pd.expanding_mean(x) for all columns except [`temp_stk_id`, 'yr'])
  </code></pre>
  
  <p>or </p>
  
  <pre><code>df.groupby(['temp_stk_id','yr']).apply(lambda x: pd.expanding_mean(x) for specified columns)
  </code></pre>
  
  <p>How to do that ?</p>