title: Any optimize way to iterate excel and provide data into pd.read_sql() as a string one by one
body: <p><a href="https://i.stack.imgur.com/MihZJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MihZJ.png" alt="I have to read this excel and get the Report2 queries, B2 (cell) and C2 (cell) and compare the resultset then Report3 queries B3 and C3 and again compare and so on ..." /></a></p>
  <pre><code>#here I have to apply the loop which can provide me the queries from excel for respective reports:
      df1 = pd.read_sql(SQLqueryB2, con=con1)
      df2 = pd.read_sql(ORCqueryC2, con=con2)
      if (df1.equals(df2)):
          print(Report2 +&quot; : is Pass&quot;)
  </code></pre>
  <p>Can we achieve above by something doing like this (by iterating ndarray)
  <code>df = pd.read_excel(path) for col, item in df.iteritems():</code>
  OR do the only option left to read the excel from &quot;openpyxl&quot; library and iterate row, columns and then provide the values. Hope I am clear with the question, if any doubt please comment me.</p>