On a Pandas dataframe I would like to apply a style on a specific column, on a multi-criteria taken from different columns values.
table =
product sales revenues
fruit 10 6
eggs 15 12
fruit 16 8
If the product is fruit I would like the sales value only (no modification on revenues) to come in red when it is below 17, if the product is eggs another criteria applies (= below 20)
So only the figure 10 should appear in red.
I tried to style.apply and style.applymap but cannot figure out a style function working with the different columns independently.
Thanks in advance for elements you could provide to help.