'How to use separated rules in a .json file to decode a .txt file using Pandas?
I have a set of data in .txt with a unique format that is described in an external .json file.
Is there any form to tell Pandas to use the rules in my json file to decode my .txt?
This is a piece of the JSON file - it has a lot of objects like this, with different values for each key.
[
{
"codigo": "V0101",
"inicio": 1,
"tamanho": 4,
"descricao": "Ano de referência",
"rotulo": "ano",
"valores": "str"
},
{
"codigo": "UF",
"inicio":5,
"tamanho":2,
"descricao": "Unidade da Federação",
"rotulo": "UF",
"valores": {"11": "Rondônia", "12": "Acre", "13": "Amazonas", "14": "Roraima", "15": "Pará", "16": "Amapá", "17": "Tocantins", "21": "Maranhão", "22": "Piauí", "23": "Ceará", "24": "Rio Grande do Norte", "25": "Paraíba", "26": "Pernambuco", "27": "Alagoas", "28": "Sergipe", "29": "Bahia", "31": "Minas Gerais", "32": "Espírito Santo", "33": "Rio de Janeiro", "35": "São Paulo", "41": "Paraná", "42": "Santa Catarina", "43": "Rio Grande do Sul", "50": "Mato Grosso do Sul", "51": "Mato Grosso", "52": "Goiás", "53": "Distrito Federal"}
},
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

