-5

I have data like this in file. I want replace the backslash from the entire data. I tried to use replace function after reading this text file but could not get the result. Could you please help.

[{"Name": "Segment1", "Value": 14.0, "Categories": "{\"MILL CREEK\": 0.0, \"FAIRPORT\": 1.0, \"PENNINGTON\": 0.0, \"GREENWICH\": 0.0
Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
Shankar Panda
  • 736
  • 3
  • 11
  • 27
  • Hi Shankar, it is always helpful to post the code which you have tried. – Rahul Chawla Jan 31 '19 at 12:16
  • Possible duplicate of [how to replace back slash character with empty string in python](https://stackoverflow.com/questions/12618030/how-to-replace-back-slash-character-with-empty-string-in-python) – testfile Jan 31 '19 at 12:16

1 Answers1

1

you need to escape backslash char

str.replace('\\', "")
Felix Martinez
  • 512
  • 5
  • 9