0

Somehow I got all unicode symbols like "\u2019m" prepended with backslashes, so python now thinks it's not a unicode coded symbol, but backslash and 4 random symbols. How can I fix that? My strings look like that now: "its not that I\u2019m a GSP fan\u002c i just"

  • 2
    can you include the example code where this is occuring? or maybe include an example input/output of what you want? – Caleb Stanford May 07 '20 at 14:11
  • 1
    Does this answer your question? [Python string to unicode](https://stackoverflow.com/questions/10268518/python-string-to-unicode) – Jongware May 07 '20 at 14:17
  • It's a dataset with tweets. print(s) yields : Tehran\u002c Mon Amour: Obama Tried to Establish Ties with the Mullahs – Zhanibek Kaimuldenov May 07 '20 at 14:20
  • If you're running Python3.x, then this is a non-issue because all strings are unicode by default and the line will output correctly. However if you're using Python2.x then that is another issue all together, and you should include it in your question / tags. – Hampus Larsson May 07 '20 at 14:21
  • yeah, that was the case, thank you @usr2564301 – Zhanibek Kaimuldenov May 07 '20 at 16:12

0 Answers0