i get ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). using pandas
问题 i get error while running this code what to do? i get error ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). unrealized = [0, 0.50, 0.90, 0.20, 3, 6, 7, 2] def stoploss(): df = pd.DataFrame({"price": unrealized}) df['high'] = df.cummax() if df['high'] <= 0.10: df['trailingstop'] = -0.50 df['signalstop'] = df['price'] < df['trailingstop'] if df['high'] >= 0.10: df['trailingstop'] = df['high'] - 0.10 df['signalstop'] = df['price'] < df[