Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
pandas json_normalize single/double quotes

I have a structure as follows:-

{
  "data" : {
      "links" :[{"url" : "https://foo", "title" : "St. Mary's Church"}]
  }
}

I am using pandas to output this to Excel format, edit and then import.

with pd.ExcelWriter(parameters['path']) as writer:
    df = pd.json_normalize(features)
    df.to_excel(writer, sheet_name="test)
    

The problem is that pandas is writing this field out as follows into the Excel column data.links:-

[{'url' : 'https://foo', 'title' : "St. Mary's Church"}]

I want to read it back in as JSON using javascript but JSON.parse fails as the object keys have single quotes. I cannot globally convert to double quotes (easily) as that causes issues with the apostrophe in St. Mary's.

Is there a better solution in pandas? Or a straightforward regex to convert the string back to JSON in javascript. I can only use native javascript, do not have access to third party libraries.

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!