#!/usr/bin/env python # coding: utf-8 # # Pandas # # We want to be able to load the following csv file which quotation marks and additional commas: # # eg. # # `"","",""BSF" code - Intermittant, see notes",""` # # should result in # # 0 1 2 3 # 0 , , "BSF" code - Intermittant, see notes, # # Let's fist make our data: # In[7]: with open("file.csv", 'w') as f: f.write("\"0\",\"1\",\"2\",\"3\"\n\"\",\"\",\"\"BSF\" code - Intermittant, see notes\",\"\"") # In[8]: get_ipython().system('cat file.csv') # In[9]: import pandas as pd # [Elzell's answer](http://stackoverflow.com/a/34043973/4244912): # In[20]: data = pd.read_csv("file.csv",sep=r'(?<="),(?=")',quotechar='"', engine = 'python') print("Before stripping:\n",data) data = data.applymap(lambda s:s[1:-1]) print("\nAfter stripping:\n",data) # This seems to work pretty well. # Now I think the answer lies in considering `","` to be the delimiter