Convert values to numeric with non numeric to NaNs by errors='coerce'
in to_numeric
and DataFrame.apply
so is possible use min
:
df['Min'] = df.apply(pd.to_numeric, errors='coerce').min(axis=1)
print (df)
A B C D Min
0 1 3 2.0 WD 1.0
1 3 WD NaN 2 2.0
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…