标签: pandas
我尝试这样做
df['VAL'] = np.where((df['FIRST'] + df['SECOND']).gt(0), np.log(df['FIRST'] + df['SECOND']), np.nan)
并获得devide by zero encountered in log。为什么条件返回True并且不将None设置为值?
devide by zero encountered in log
True
None