How to fillna() with value 0 after calling resample?
<p>Either I don't understand the <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.fillna.html">documentation</a> or it is outdated.</p>

<p>If I run </p>

<pre><code>user[["DOC_ACC_DT", "USER_SIGNON_ID"]].groupby("DOC_ACC_DT").agg(["count"]).resample("1D").fillna(value=0, method="ffill")
</code></pre>

<p>It get</p>

<pre><code>TypeError: fillna() got an unexpected keyword argument 'value'
</code></pre>

<p>If I just run</p>

<pre><code>.fillna(0)
</code></pre>

<p>I get </p>

<pre><code>ValueError: Invalid fill method. Expecting pad (ffill), backfill (bfill) or nearest. Got 0
</code></pre>

<p>If I then set</p>

<pre><code>.fillna(0, method="ffill") 
</code></pre>

<p>I get </p>

<pre><code>TypeError: fillna() got multiple values for keyword argument 'method'
</code></pre>

<p>so the only thing that works is</p>

<pre><code>.fillna("ffill")
</code></pre>

<p>but of course that makes just a forward fill. However, I want to replace <code>NaN</code> with zeros. What am I doing wrong here?</p>

<p>Well, I don't get why the code above is not working and I'm going to wait for somebody to give a better answer than this but I just found</p>

<pre><code>.replace(np.nan, 0)
</code></pre>

<p>does what I would have expected from <code>.fillna(0)</code>.</p>

python pandas