I'm reading data from a CSV that has single quotes, but I don't want the quotes to be part of the internal data. I'm used to the tradition that quotes are optional, and can be used to handle commas within the string fields. So rather than changing the input file, how I can remove quotes using Pandas, rather than stripping them out in the code itself.
dfRules = pd.read_csv(filenameRules, quoting=csv.QUOTE_NONE, quotechar="'") print ("---- Data Head ---- ") print (dfRules.head()) DataFile
PAYEECONTAINS,CATEGORY 'SOUTHWEST AIRLINES','Travel' 'GODADDY','Internet Services' 'AIRBNB','Travel' Output:
---- Data Head ---- PAYEECONTAINS CATEGORY 0 'SOUTHWEST AIRLINES' 'Travel' 1 'GODADDY' 'Internet Services' 2 'AIRBNB' 'Travel'