Generation

generate functionMon, 20 Feb 2023

There is a Pandas code: df2.style.highlight_max(axis=1, props='color:white;\ font-weight:bold;\ background-color:green;') df2.style.highlight_min(axis=1, props='color:white;\ font-weight:bold;\ background-color:brown;') Write a function that combines these two actions into one and returns the changed dataframe

def highlight(df): return df.style.highlight_max(axis=1, props='color:white;\ font-weight:bold;\ background-color:green;') return df.style.highlight_min(axis=1, props='color:white;\ font-weight:bold;\ background-color:brown;') #your code here

Questions about programming?Chat with your personal AI assistant