0
如果某些条件为真,我试图将值从0更新为值1。这里是我的代码:有条件更新数据帧列
df_['win'] = 0
df_.loc[df_['predicted_spread'] > df_['vegas_spread'] and df_['actual_spread'] > df_['vegas_spread'], 'win'] = 1
这是我得到的错误:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
有谁知道这是怎么回事上的任何想法?
出色地工作!谢谢! – user3294779