title: Python Pandas compare strings in data frame row excluding empty string
body: <p>I have a data frame that i would like to compare string values in same row. Row includes empty strings also.
  Following code makes the job but unfortunately return True when both strings are "None" i.e. empty strings</p>
  
  <pre><code>Col = list(ENTITY.columns.values)
  for i in combinations(Col,2):
      df[i[0]+' to '+i[1]+' dedication'] =df.apply(lambda row: row[i[0]] == row[i[1]],axis=1)
      df[i[0]+' to '+i[1]+' dedication'] = np.where(df[i[0]+' to '+i[1]+' dedication'], 'Y', 'N')
  </code></pre>
  
  <hr>
  
  <p>For instance, if <code>row[i[0]] == "AAA1" and row[i[1]] == "AAA1"</code> the output will be <code>True</code>, but if <code>row[i[0]] == "AAA1" and row[i[1]] == None</code> or if <code>row[i[0]] == None and row[i[1]] == None</code> the output will be False.</p>
  
  <p>How can i resolve this issue when True statement will be when both strings are not empty and matched?
  Is it possible to use operators isinstance and basestring in lambda function?
  Desired output:
  <a href="https://i.stack.imgur.com/SJxAL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SJxAL.png" alt="enter image description here"></a>
  Thank you</p>