title: pandas Iterate through Rows & Column and print it based on some condition
body: <p>I have an excel file &amp; I Processed that file for Data Analysis and Created a <code>Data Frame(Pandas).</code><br/>
  Now I Need to Get the result ,
  I'm trying to get it through iterating over pandas columns and rows using <code>for &amp; if</code> Condition But I'm not getting desired output.  <br/>
  I've Taken hyphen(-) in excel file so that I can apply some conditions.</p>
  <p>Excel File
  <a href="https://i.stack.imgur.com/PqkHz.png" rel="nofollow noreferrer">Input_File</a></p>
  <pre><code>Required Output
  A -&gt; B -&gt; C -&gt; E -&gt; I
  F -&gt; G -&gt;L
  H -&gt; J -&gt; K 
  A1 -&gt; B1
  C1 -&gt; A1
  Z -&gt; X
  Note: Saving Output in Text file in plain. No need of Graph / Visualization
  </code></pre>
  <p>code</p>
  <pre><code>df =  pd.read_excel('Test.xlsx')
  df.fillna('-')
       
  # Below code answer Z -&gt; X
  for index, row in df.iterrows():
      if row['Start_Name'] != '-':
          if row['End_Name'] != '-':
              print(row['Start_Name'] +' -&gt; '+ row['End_Name'])
  
  # Below code answer A -&gt; B / F -&gt; G / H -&gt; J / C1 -&gt; A1     
  for index, row in df.iterrows():
      if row['Start_Name'] != '-':
          if row['Mid_Name_1'] == '-':
              if row['Mid_Name_2'] != '-':
                  print(row['Start_Name'] +' -&gt; '+ row['Mid_Name_2'])
  
  # Below code answer B -&gt; C /  C -&gt; E
  for index, row in df.iterrows():
      if row['Mid_Name_1'] != '-':
          if row['Mid_Name_2'] != '-':
              print(row['Mid_Name_1'] +' -&gt; '+ row['Mid_Name_2'])
  
  </code></pre>