title: How to remove duplicated values on the same row in Pandas?
body: <p>I have merged 2 DataFrames in pandas, both of them containing the same columns, but with different values on some rows. As example:</p>
  <pre><code>df1:
       A   B
       1   x
       2   y 
       3   z
  df2: A   B
       1   x, y
       2   y, x, z
       4   z
  df = pd.merge(df1, df2, how='inner', on=['A']
  </code></pre>
  <p>I was expecting for an output that combined the rows like this:</p>
  <pre><code>df:
      A   B
      1   x, y
      2   x, y, z 
  </code></pre>
  <p>But instead, i got something like this:</p>
  <pre><code>df:
      A   B_x   B_y
      1   x     x, y
      2   y     y, x, z
  </code></pre>
  <p>Is there any way that i can get my output somehow like I wanted? I know i can combine both B_x and B_y into a new column and then drop the B_x and B_y columns, but the output wouldn't be the same as I wanted:</p>
  <pre><code>df['B'] = df['B_x'] +', '+ df[B_y']
  
  df.drop(columns=['B_x', 'B_y']
  
  #The output then will look like this:
  df:
      A   B
      1   x, x, y
      2   y, x, y, z 
  </code></pre>
  <p>Is there any way that I can drop the duplicated values from the same row if I combine these columns like that? Or any way to get an output like the one I want since the beggining?. Sorry if the answer is too obvious, but I'm new using pandas (and also not so experienced in programming), but if you can answer me, it will be very helpful.
  Thanks!</p>