# Function to highlight text of max value in a dataframe def highlight_max(s): is_max = s == s.max() return ['color: green' if cell else '' for cell in is_max] df.style.apply(highlight_max,axis=1)