title: format phone number in csv using pandas
body: <p>Python/pandas n00b. I have code that is processing event data stored in csv files. Data from <code>df["CONTACT PHONE NUMBER"]</code> is outputting the phone number as `5555551212.0' Obviously, the ".0" is a problem, but added because it's an integer, I imagine? </p>
  
  <p>Anyhoo, I decided that I should format the phone number for usability's sake.</p>
  
  <p>The number comes from the csv file, unformatted. The number will always be ten digits: 5555551212, but I would like to display it as (555)555-1212. </p>
  
  <pre><code>import glob
  import os
  import pandas as pd
  import sys
  
  csvfiles = os.path.join(directory, '*.csv')
  for csvfile in glob.glob(csvfiles):
      df = pd.read_csv(filename)
      #formatting the contact phone
      phone_nos = df["CONTACT PHONE NUMBER"]
      for phone_no in phone_nos:
          contactphone = "(%c%c%c)%c%c%c-%c%c%c%c" % tuple(map(ord,phone_no))
  </code></pre>
  
  <p>The last line gives me the following error: 
  <code>not enough arguments for format string</code></p>
  
  <p>But maybe this isn't the pandas way of doing this. Since I'm iterating through an array, I also need to save the data in its existing column or rebuild that column after the phone numbers have been processed.</p>