0

Thanks for reading. I'm working with this code right here:

df=client.query(SQL).to_dataframe()
df.insert(0,"bang", '\"!\"', allow_duplicates=True)

When I run it in Google Colabs/Python/Pandas, I get this: """!"""

I really need just one quotation like this: "!".

Let me know if you guys have ever encountered this issue.

Kevin
  • 2,234
  • 2
  • 21
  • 26
  • Hrm.. try `df.insert(0,"bang", r'\"!\"', allow_duplicates=True)` Reason why this may work... https://stackoverflow.com/q/2081640/6361531 – Scott Boston Aug 05 '20 at 18:34

1 Answers1

0

I am not that familiar with pandas, but in somethings like the excel dialect of python's csv package, a specific alternative escape sequence is preferred. Like double-quotes being escaped by another double-quote.

There does already seem to be some questions examining this.

Kevin
  • 2,234
  • 2
  • 21
  • 26