title: Fill empty columns with values from another column of another row based on an identifier
body: <p>I am trying to fill a dataframe, containing repeated elements, based on an identifier.
  My Dataframe is as follows:</p>
  <pre><code>   Code Value
  0  SJHV   
  1  SJIO    96B
  2  SJHV    33C
  3  CPO3    22A
  4  CPO3    22A
  5  SJHV    33C       #&lt; -- Numbers stored as strings
  6   TOY   
  7   TOY             #&lt; -- These aren't NaN, they are empty strings
  </code></pre>
  <p>I would like to remove the empty 'Value' rows only if a non-empty 'Value' row exists. To be clear, I would want my output to look like:</p>
  <pre><code>   Code Value
  0  SJHV    33C
  1  SJIO    96B
  2  CPO3    22A      
  3   TOY         
  </code></pre>
  <hr />
  <p>My attempt was as follows:</p>
  <pre><code>df['Value'].replace('', np.nan, inplace=True)
  
  df2 = df.dropna(subset=['Value']).drop_duplicates('Code')
  </code></pre>
  <p>As expected, this code also drops the 'TOY' Code. Any suggestions?</p>