title: How to merge two columns under certain conditions in a third one
body: <p>I am rather new to Pandas and I struggle to solve this problem :</p>
  
  <p>I have a DataFrame with doctors' activities. </p>
  
  <pre><code>pd0.info()                                                                                                                                                                                                 
  &lt;class 'pandas.core.frame.DataFrame'&gt;
  Int64Index: 14059 entries, 0 to 4418
  Data columns (total 22 columns):
  dossier               14059 non-null object
  code_praticien        14059 non-null object
  nom_praticien         14059 non-null object
  code_anesthesiste     13128 non-null object
  nom_anesthesiste      13128 non-null object
  patient               14059 non-null object
  sexe_patient          14059 non-null object
  date_naiss_patient    14059 non-null datetime64[ns]
  date                  14059 non-null datetime64[ns]
  heure                 13842 non-null float64
  ccam_ngap_diag        13852 non-null object
  libelle               14059 non-null object
  association           7682 non-null float64
  modificateur1         11340 non-null object
  modificateur2         1262 non-null object
  modificateur3         8 non-null float64
  modificateur4         0 non-null float64
  montant_ccam          13684 non-null float64
  montant_ngap          207 non-null float64
  depassement           14049 non-null float64
  total                 13901 non-null float64
  praticien             13128 non-null object
  dtypes: datetime64[ns](2), float64(8), object(12)
  memory usage: 2.8+ MB
  </code></pre>
  
  <p>Two columns contain the surgeon code ('code_praticien') and the anesthesiologist code ('code_anesthesiste') :</p>
  
  <pre><code>test = pd0[['code_praticien', 'code_anesthesiste']]
  test                                                                                                                                                                                                       
  Out[65]: 
       code_praticien code_anesthesiste
  0            BENY00            MORA01
  1            BENY00            MORA01
  2            BENY00            MORA01
  3            BENY00            MORA01
  4            BENY00            MORA01
  ...             ...               ...
  4414         GAUD00            SAVO01
  4415         SAVO01            SAVO01
  4416         GAUD00            SAVO01
  4417         GAUD00            SAVO01
  4418         SAVO01            SAVO01
  
  [14059 rows x 2 columns]
  </code></pre>
  
  <p>I am trying to deal with the case where the "surgeon" IS the anesthesiologist (e.g : pain control procedures).
  In that case, we have 'code_anesthesiste' NaN and 'code_praticien' which is one of the anesthesiologists codes.
  I created a new column 'anesthesiste' which will contain either the 'code_anesthesiste' when not null, or 'code_praticien'
  when 'code_anesthesiste' isnull() and 'code_praticien' isin([List of valid code_anesthesiste]).</p>
  
  <pre><code>test['anesthesiste'] = test.code_anesthesiste
  test.loc[test.code_anesthesiste.isnull() &amp; test.code_praticien.isin(['MORA01', 'SAVO01'])].anesthesiste = pd0.code_praticien
  </code></pre>
  
  <p>But I keep getting this error  : "ValueError: cannot reindex from a duplicate axis"
  I googled about 'duplicate axis' but can't understand where is my mistake...</p>
  
  <p>I had a look at the fillna() function, but it doesn't seem adequate as I don't want to have surgeons' codes in the 'anesthesiste' column, (sometimes surgeon works without anesthesiologist, then I have 'code_anesthesiste' NaN, 
  but 'code_praticien' is not an anesthesiolgist's code).</p>
  
  <p>Thanks for your help.</p>