title: Fill NaNs in rows with duplicated field based on another field value
body: <p>I have the following table:\</p>
  <pre><code>Name  | ID  |  Azimut\
  foo   | 1   |  180\
  foo   | 6   |  NaN\
  bar   | 1   |  NaN\
  bar   | 6   |  200 
  </code></pre>
  <p>I want to search for duplicates that have IDs with the value of 1  or 6 (the table can have other numbers) and if the &quot;Azimut&quot; value is NaN, complete it with the value of its corresponding duplicate, returning the following:</p>
  <pre><code>Name  | ID  |  Azimut\
  foo   | 1   |  180\
  foo   | 6   |  180\
  bar   | 1   |  200\
  bar   | 6   |  200 
  </code></pre>
  <p>What I've tried so far:</p>
  <pre><code>nan_rows = df.loc[(df['ID'] == 6) &amp; (df['Azimut'].isna())]
  values = df.loc[(df['Name'].isin(nan_rows['Name'])) &amp; (df['ID'] == 1), 'Azimut']
  df.loc[(df['ID'] == 6) &amp; (df['Azimut'].isna(), 'Azimut'] = values.values
  </code></pre>
  <p>I would have to do similar code for the reverse case (ID = 1 is NaN and complete with ID = 6), and it wouldn't work if there is no pair of IDs 1 and 6 (It doesn't verify the duplicates). I hope the question is well redacted and I'm listening for any way I could improve it.</p>