title: Pandas highlighting excel columns with conditions using a function
body: <p>I have a pandas data-frame (Pre_Final_DataFrame) that I am writing to excel. </p>
  
  <p>I need to highlight a row in Excel if that corresponding row has a "No Match" word on any of the column that starts with 'Result_'.</p>
  
  <p>So, I decided to go for an array to understand which one needed to be highlighted.</p>
  
  <p>But now, I would prefer a way to highlight using a function as it is too slow. 
  Kindly help me with this.</p>
  
  <p>In Simple words, I am writing a dataframe to excel using Pandas and it has million records and I want a row to be highlighted in "Yellow" only when there is a No Match value present in any one of the column that has a name starting with " Result_"</p>
  
  <p>The Expected result appears in excel looks like below,</p>
  
  <p>Input codes to start with a dataframe:-</p>
  
  <pre><code>import pandas as pd
  
  data = {
       'ColA':[1, 1], 
       'ColB':[1, 1],
       'Result_1':['Match', 'Match'], 
       'ColA1':[1, 2], 
       'ColB1':[1, 1],
       'Result_2':['No Match', 'Match'],  
       }
  
  Pre_Final_DataFrame = pd.DataFrame(data)
  
  ResultColumns_df = Pre_Final_DataFrame.filter(like='Result_')
  ResultColumns_df_false =ResultColumns_df[ResultColumns_df.values  == "No Match"]
  RequiredRows_Highlight = ResultColumns_df_false.index.tolist()
  
  writer = pd.ExcelWriter(OutputName,date_format='%YYYY-%mm-%dd',datetime_format='%YYYY-%mm-%dd')
  Pre_Final_DataFrame.to_excel(writer,'Sheet1',index = False)
  writer.save()
  </code></pre>
  
  <p>Output Expected:</p>
  
  <p><a href="https://i.stack.imgur.com/Vw1iy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vw1iy.png" alt="enter image description here"></a></p>