title: How to check if 3 columns are same and add a new column with the value if the values are same?
body: <p>I have a dataframe that look like this..</p>
  <pre><code>index   Column A    Column B    Column C
  0        alice       alice       alice
  1        nick        nick        john
  2        juli        nick        alice
  
  </code></pre>
  <p>I want to check in <code>Column A, Column B and Column C</code> are equal or not. If equal, I want to add the the value as a new <code>Column D</code>. If not, add <code>None</code> to <code>Column D</code></p>
  <p>I did this so far..</p>
  <pre><code>def func(row):
      if ((row['Column A']) == (row['Column B']) == (row['Column C'])):
          df['Column D'] = df['Column A']
      else:
          df['Column D'] = None
  
  </code></pre>
  <p>When I applied the function using..
  <code>df.apply (lambda row: func(row),axis =1)</code>, I am not getting the desired output.</p>
  <p>I got something like this..</p>
  <pre><code>index   Column A    Column B    Column C    Column D
  0      alice        alice       alice        None
  1      nick         nick        john         None
  2      juli         nick        alice        None
  
  </code></pre>
  <p>whereas, I want the output to be like..</p>
  <pre><code>index   Column A    Column B    Column C    Column D
  0      alice        alice       alice        alice
  1      nick         nick        john         None
  2      juli         nick        alice        None
  
  </code></pre>
  <p>Any help on this?</p>