Hello I have this code and in my dataframe I have some NaN values and I'd like to use the for a condition as you can see
if df['stoch_slowk'].isna():
df['action']='attendre'
if df['stoch_slowk'] < 20:
df['action'] ='Vendre'
elif df['stoch_slowk'] > 80:
df['action'] ='Acheter'
elif df['stoch_slowk'] > 20 and df['stoch_slowk'] < 80:
if df['stoch_slowd'] > 20:
df['action'] ='Acheter'
elif df['stoch_slowd'] < 80:
df['action'] ='Vendre'
else:
df['action'] ='Attendre'
If you could help me, thank you
I have this error : ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().