<p>这里有一个简单的问题——如何用零替换列中的所有空白?</p>
<p>例如:</p>
<pre><code> Name Age
John 12
Mary
Tim 15
</code></pre>
<p>进入</p>
<pre><code> Name Age
John 12
Mary 0
Tim 15
</code></pre>
<p>我一直在尝试这样的方法,但我不确定熊猫到底是如何读取空白的:</p>
<pre><code> merged['Age'].replace(" ", 0).bfill()
</code></pre>
<p>有什么想法吗?</p>