Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

235
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda