highlight (color) a panda data frame row by index
In case you want to highlight two rows (say index 2 and 4) it is a almost a duplicate of this answer
new_df.style.apply(lambda x: ['background: lightgreen' if x.name in [2,4]
else '' for i in x],
axis=1)
If instead you are looking to highlight every row that contain a given name in a list (i.e. lst = ['car', 'boat']
) you can use
new_df.style.apply(lambda x: ['background: lightgreen' if (set(lst).intersection(x.values))
else '' for i in x],
axis=1)