title: Python to retrieve condition based columns
body: <p>I have to retrieve all rows from w_loaded_updated_iod.xlsx where on column waived = Yes.</p>
  
  <p><a href="https://i.stack.imgur.com/sYNyu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sYNyu.png" alt="enter image description here"></a></p>
  
  <p>I have tried this:</p>
  
  <pre><code>    import pandas as pd
      excel1 = 'C:/Users/gopoluri/Desktop/Latest/w_loaded_updated_iod.xlsx'
      df1 = pd.read_excel(excel1)
      values1 = df1[0 : 7]
      dataframes = [values1]
      df1.loc[df1['Waived'] == 'Yes'].to_excel("output11.xlsx")
  </code></pre>
  
  <p>But I am getting and all columns. But I need the all rows only from column 2, column 3, column 5, column8. Can anyone please correct my code if anything is wrong.
  Like below:
  <a href="https://i.stack.imgur.com/JTf7G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JTf7G.png" alt="enter image description here"></a></p>