title: Pandas error : can only use .str accessor with string values which use no.object dtype
body: <p>My input file is a Json file</p>
  
  <pre><code>{ "infile":"c:/tmp/cust-in-sample.xlsx",
     "SheetName":"Sheet1",
     "CleanColumns":[1,2],
     "DeleteColumns":[3,5],
     "outfile":"c:/tmp/out-cust-in-sample.csv"            
  }
  </code></pre>
  
  <p>I would like to have specified columns in json to cleaned and deleted. However I'm getting the pandas string error.</p>
  
  <p>I'm currently trying this code:</p>
  
  <pre><code>import json
  import pandas as pd
  import gzip
  import shutil
  import sys
  
  zJsonFile = sys.argv[-1]
  
  iCount = len(sys.argv)
  
  
  if iCount == 2:
      print "json file path " ,zJsonFile
  else:
      print "need a json file path ending the script"
      sys.exit()
  
  
  with open(zJsonFile,'rb') as zTestJson:
      decoded = json.load(zTestJson)
  
  #Parameterizing the code, reading each key from 'decoded' variable and putting it into another variable for the purpose 
  #of parameterizing
  
  Infile = decoded.get('infile')
  print Infile
  
  
  Outfile = decoded.get('outfile')
  print Outfile
  
  
  Sheetname = decoded.get('SheetName')
  print Sheetname
  
  # this is a list
  deletecols = decoded.get('DeleteColumns')
  print deletecols
  
  #this is a list
  cleancols = decoded.get('CleanColumns')
  print cleancols
  input_sheet = pd.ExcelFile(Infile)                            
  dfs = {}                                                     
  for x in [Sheetname]:                          
      dfs[x] = input_sheet.parse(x)
      print dfs                                             
  
  df = pd.DataFrame(dfs[x])             # COnverting dict to dataframe
  print df
  deletecols = df.columns.values.tolist()
  cleancols = df.columns.values.tolist()
  for idx,item in enumerate(deletecols):
      df.pop(item)
  #df.drop(df.columns[deletecols],axis=1,inplace=True)   
  #Cleaning the code
  #cleancols=[]
  for x in cleancols:                                                                       
      df[x] = df[x].str.replace(to_replace = '"', value = '', regex = True)
      df[x] = df[x].str.replace(to_replace = "'", value = '', regex = True)
      df[x] = df[x].str.replace(to_replace = ",", value = '', regex = True)
  </code></pre>
  
  <p>I tried df.pop, df.drop nothing of this looks like its working for me and neither creating a loop and looping through cleancols is cleaning my file.</p>
  
  <p>Any help is highly appreciated.!</p>