请您参考如下方法:
使用pd.to_numeric
例如:
df = pd.DataFrame({"Price": ["Nil", "Na", 1,2,3,4,5, "Null"]})
print(df[pd.to_numeric(df['Price'], errors='coerce').notnull()].sum())
#or
print(pd.to_numeric(df['Price'], errors='coerce').dropna().sum())
输出:
Price 15.0
dtype: float64
