擅长:python、mysql、java
<h3><code>mask</code>与<code>inplace=True</code></h3>
<pre><code>df['column'].mask(df['column'].eq(0), inplace=True)
</code></pre>
<hr/>
<h3><code>np.where</code></h3>
<pre><code>a = df['column'].to_numpy()
df['column'] = np.where(a, a, np.nan)
</code></pre>