title: pandas: modifying values in dataframe from another column
body: <p>While splitting data into columns, there was some glitch, due to which I have got some noisy data.</p>
  <pre><code>    site          code
      ---           ---
  0   apple_123     45
  1   apple_456     xy_33
  2   facebook_123  24
  3   google_123    NaN
  4   google_123    pq_51
  </code></pre>
  <p>I need to clean the data, such that I get the following result:</p>
  <pre><code>    site            code
      ---             ---
  0   apple_123       45
  1   apple_456_xy    33
  2   facebook_123    24
  3   google_123      NaN
  4   google_123_pq   51
  </code></pre>
  <p>I have been able to obtain the rows that need to be modified, but am unable to progress further:</p>
  <pre><code>import numpy as np
  import pandas as pd
  
  site = ['apple_123','apple_456','facebook_123','google_123','google_123']
  code = [45,'xy_33',24,np.nan,'pq_51']
  df = pd.DataFrame(list(zip(site,code)), columns=['site','code'])
  
  df[(~df.code.astype(str).str.isdigit())&amp;(~df.code.isna())] 
  </code></pre>