title: Make a values of column into new column and check for duplicates in other column ,print 1 in the value column if other column duplicated
body: <p>I have a column A,B,C,D A column has value x1,x2,x3,x4,x5 create a column x1,x2,x3,x4,x5 and print 1 if B,C,D has a duplication</p>
  <p>Please provide an answer using pyspark or python pandas</p>
  <p>Input</p>
  <pre><code>A   B   C   D
  
  X1  a   b   c
  
  X2  a   a   b
  
  X3  a   a   b
  
  X4  a   b   c
  </code></pre>
  <p>Output</p>
  <pre><code>B   C   D   X1  X2  X3  X4
  
  a   b   c   1   0   0   1
  
  a   a   b   0   1   1   0
  </code></pre>
  <p>I tried to find duplicate of column and then create a column duplicate flag which prints 1 if other column are duplicated
  df['duplicate_flag']=df.duplicated(subset['B','C','D'])</p>
  <p>my problem here i don't know to compare it with column A and print it in X1,X2,X3,X4</p>
  <p>any one can help with python? i am new to python</p>