Pandas dataframe tabulation styling

def color_red_negative(x):

    color = 'red' if x<0 else 'white'

    return 'color: ' + color

In week 11, styling tabulation Foundations to Data Science. Please elaborate return function(why ‘color:’ + color is used as shown above).
Thank You

Please check this for detailed explanation:

2 Likes