How to convert DatetimeIndexResampler to DataFrame?
<p>I want to build a matrix from series but before that I have to resample those series. However, to avoid processing the whole matrix twice with <code>replace(np.nan, 0.0)</code> I want to append the dataframes to a collecting dataframe and then remove <code>NaN</code> values in one pass.</p>

<p>So instead of</p>

<pre><code>user_activities = user.groupby(["DOC_ACC_DT", "DOC_ACTV_CD"]).agg("sum")["SUM_DOC_CNT"].unstack().resample("1D").replace(np.nan, 0)
df = df.append(user_activities[activity].rename(user_id))
</code></pre>

<p>I want</p>

<pre><code>user_activities = user.groupby(["DOC_ACC_DT", "DOC_ACTV_CD"]).agg("sum")["SUM_DOC_CNT"].unstack().resample("1D")
df = df.append(user_activities[activity].rename(user_id))
</code></pre>

<p>but that is not working because <code>user_activities</code> is not a dataframe after <code>resample()</code>. </p>

<p>The error suggests that I try <code>apply()</code> but that method expects a parameter:</p>

<pre><code>/usr/local/lib/python2.7/dist-packages/pandas/core/groupby.pyc in _make_wrapper(self, name)
    507                    "using the 'apply' method".format(kind, name,
    508                                                      type(self).__name__))
--&gt; 509             raise AttributeError(msg)
    510 
    511         # need to setup the selection

AttributeError: Cannot access callable attribute 'rename' of 'SeriesGroupBy' objects, try using the 'apply' method
</code></pre>

<p>How can I solve this issue?</p>