I am Currently trying to create IF statements to apply a class element to certain cells so I can style them using CSS. I currently can't use the styling options that pandas gives because I am using the .to_html function.
My table is as follows. {'Pwer':[-.3,-1.3,-2.4], 'Trend':[1.3,-1.3,-1.7]}
I tried
if((hist['Pwer']<0) & (hist['Trend']<0)):
hist['Pwer']=hist['Pwer'].apply(lambda x:'<span class="Negative Trend_neg">{0}</span>'.format(x))
But it results in
The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
I'm not quite sure I understand what is going on even if I apply .all() to both hist['Pwer'] and hist['Trend']. Any help would be appreciative.