title: Pandas APPLY - Dataframe has NULL values
body: <p>I am trying to clean phone numbers using phonenumbers library.
  I created function to get country code &amp; national number and store in columns 'country_code' and 'national_number'</p>
  <p>I am trying to use apply() on dataframe which has noisy numbers. I am trying to use apply over loop due to performance gain.
  Below is code:</p>
  <pre><code>import phonenumbers
  import pandas as pd
  df_phone = pd.read_csv(r'D:\Code\Address-Nominatim\Address-Nominatim\Phone_Valid.csv',encoding='utf8')
  df_phone['country_code'] = ''
  df_phone['national_number'] = ''
  df_phone['valid']=''
  
  def phone_valid(phone):
      try:
          #print(phone['PHONE'] + &quot; &quot; + phone['COUNTRY'])
          x = phonenumbers.parse(phone['PHONE'],phone['COUNTRY'])
          df_phone['country_code'] = x.country_code
          df_phone['national_number'] = x.national_number
          df_phone['valid']=phonenumbers.is_possible_number(x)
      except:
          df_phone['country_code'] = &quot;Error&quot;
          df_phone['national_number'] = &quot;Error&quot;
  
  
  df_phone=df_phone.apply(phone_valid,axis=1)
  
  print(df_phone)
  </code></pre>
  <p>but dataframe df_phone only has none values.Below is sample output of df_phone</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>none</th>
  <th>none</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>none</td>
  </tr>
  <tr>
  <td>2</td>
  <td>none</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Can someone tell me what mistake I am making?</p>
  <p>Regards,</p>