title: If else conditions in python
body: <p>I want check string in Columns[0] and if we have &amp; symbol in the column[0] string then need to return columns[1] value otherwise return columns[0] string on that row.
  i tried to use below login but is not returning expected result
  X = dataframe</p>
  <pre><code>x.iloc[:,0]
  x.iloc[:,1]
  for i in :
      if (x.iloc[i,0].str.contains(pat ='&amp;')).all() == 'TRUE':
          print(x.iloc[i,1])
      else:
          print(x.iloc[i,0])
  </code></pre>
  <p>Below is the sample dataframe columns</p>
  <pre><code>NE Name                 Subrack
  ABC                      master
  Site1&amp;site2              site1
  site3&amp;site4              site3
  site5                    master
  site6&amp;site8              site6
  </code></pre>
  <p>thanks</p>