1

I have a specific problem, we are moving our from old to a new system. Old databse was adjusted to a new one with Pandas. However, I am facing a problem.

If file opened with SQL or Csv, it has outer quotes, "UUID_TO_BIN('5e6f7922-8ae9-11ea-a3bd-888888888788', true)"

I need to make sure it has no upper quotes like this: UUID_TO_BIN('5e6f7922-8ae9-11ea-a3bd-888888888788', true)

What could be pandas solution to do this for specific columns, on exporting saving to SQL or csv? Because now it's as a string and returns like this?

ValdemarT
  • 77
  • 5
  • Does this answer your question? [pandas data with double quote](https://stackoverflow.com/questions/51359010/pandas-data-with-double-quote) – Henrique Branco Apr 30 '20 at 14:07

2 Answers2

2

If your problem is that the old system produces files like .csv with the quotes, you might just want to edit the .csv file itself as described here

If your problem is that pandas saves it as a string with double quotes you can either run the same thing on the csv output of pandas, or you could pass the .to_csv() function the argument

quotechar=''

for which you can find more info on this page

1

Try to read your data in Pandas using:

df = pd.read_csv(filename, sep=',').replace('"','', regex=True)

This reading line should remove the " " from your data.

Henrique Branco
  • 1,778
  • 1
  • 13
  • 40