title: Converting string with `\` into json or dictionary data
body: <p>I have a csv column data as below that the TA from the previous semester said we could export and import as json.</p>
  
  <pre><code>"""[
      {\""type\"": \""account\"", \""data\"": {\""bid\"": 12, \""acc_num\"": 22}}, 
      {\""type\"": \""card\"", \""data\"": {\""card_num\"": 85}}
  ]"""
  </code></pre>
  
  <p>Unlike what he said, I couldn't import it with <code>json</code> type in Postgres. But I could import it as <code>character varying</code> or <code>text</code> type. In both cases, the data is fetched into a python string as below. </p>
  
  <pre><code>[
      {\type\: \account\, \data\: {\bid\: 12, \acc_num\: 22}},
      {\type\: \card\, \data\: {\card_num\: 85}}
  ]
  </code></pre>
  
  <p>Given its original form, what do you think is a working and efficient way to turn it into a python data or json data? I've tried</p>
  
  <p>1) Converting <code>\</code> into <code>"</code> with <code>.replace("\\",'\"')</code> : it didn't work well as there are <code>\t</code> and <code>\b</code> and stuffs like that.</p>
  
  <p>2) <code>json.loads(string)</code> : <code>json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes:</code> error. Knew I couldn't just do it as it is not a right json form, but there I tried.</p>
  
  <p>edit)
  One row from the csv file</p>
  
  <p>name,phone,local,domain,passwd,payments,lat,lng</p>
  
  <pre><code>Daivd,01095434668,tfalkc,smh.com.au,8mf3trl,"""[{\""type\"": \""account\"", \""data\"": {\""bid\"": 12, \""acc_num\"": 710831175086172}}, {\""type\"": \""card\"", \""data\"": {\""card_num\"": 8543466885434668}}, {\""type\"": \""card\"", \""data\"": {\""card_num\"": 1221510412215104}}, {\""type\"": \""card\"", \""data\"": {\""card_num\"": 4871213148712131}}]""",37.6274,126.98167 
  </code></pre>