擅长:python、mysql、java
<p>以下各项可用于解决该问题:</p>
<pre><code># 1) works if you're ok with dropping NA
pd.Series([1,pd.NA],dtype='Int8').dropna().astype(int).value_counts(normalize=True)
# 2) works if you're ok with switching to a non-extension datatype such as float
pd.Series([1,pd.NA],dtype='Int8').astype(float).value_counts(normalize=True)
# 3) The issue may be fixed in a future versions of pandas. Try using a pandas version >= 1.1
</code></pre>