[Python] Converting components of Array Struct as columns in python

Discussão em 'Python' iniciado por Stack, Janeiro 27, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to unnest array struct column in python. Datasource is a json file with following structure- Would like to split tag column such that each key becomes a column and each value becomes its respective value for the entry. If a particular entry doesn't have a tag then corresponding value should be blank. Any suggestions on how to achieve this will be very helpful, TIA!

    Current data structure- {"Account ID": "101356","AccountName":"Account1","Tags":[{"key"="AppGroupEmail", "value"="testteam"}, {"key"="SNOW", "value"="TASK21002089571"}, {"key"="ClientID"," value"="220001"}]} {"Account ID": "101357","AccountName":"Account2","Tags":[{"key"="ClientID", "value"="220007"}, {"key"="BuildTicket", "value"="TM21001412480"}, {"key"="AccountType"," value"="Dev"}]}

    Expected outcome- enter image description here

    Continue reading...

Compartilhe esta Página