Untitled
unknown
python
2 years ago
3.0 kB
4
Indexable
import pandas as pd import json json_data = { "class": "dataset", "value": { "0": 2.1, "1": 1.5, "2": 0.8, "3": 1, "4": 2.2, "5": 2.1, "6": 1.5, "7": 1.4, "8": 2.8, "9": 1.2, "10": 0.5, "11": 0.6, "12": 1.8, "13": 2.2, "14": 2.3, "15": 1.2, "16": 0.4, "17": 3.2, "18": 0.4, "19": -1.6, "20": -1.1, "21": -1.3, "22": 1.2, "23": 2.6, "24": 2.5, "25": 1.2, }, "dimension": { "unit": { "label": "unit", "category": { "index": { "RCH_A_AVG": 0 }, "label": { "RCH_A_AVG": "Annual average rate of change" } } }, "coicop": { "label": "coicop", "category": { "index": { "CP00": 0 }, "label": { "CP00": "All-items HICP" } } }, "geo": { "label": "geo", "category": { "index": { "AT": 0, "BE": 1, "BG": 2, "CY": 3, "CZ": 4, "DE": 5, "DK": 6, "EE": 7, "EL": 8, "ES": 9, "FI": 10, "FR": 11, "HR": 12, "HU": 13, "IE": 14, "IT": 15, "LT": 16, "LU": 17, "LV": 18, "MT": 19, "PL": 20, "PT": 21, "RO": 22, "SE": 23, "SI": 24, "SK": 25 }, "label": { "AT": "Austria", "BE": "Belgium", "BG": "Bulgaria", "CY": "Cyprus", "CZ": "Czechia", "DE": "Germany (until 1990 former territory of the FRG)", "DK": "Denmark", "EE": "Estonia", "EL": "Greece", "ES": "Spain", "FI": "Finland", "FR": "France", "HR": "Croatia", "HU": "Hungary", "IE": "Ireland", "IT": "Italy", "LT": "Lithuania", "LU": "Luxembourg", "LV": "Latvia", "MT": "Malta", "PL": "Poland", "PT": "Portugal", "RO": "Romania", "SE": "Sweden", "SI": "Slovenia", "SK": "Slovakia" } } }, "time": { "label": "time", "category": { "index": { "2013": 0, "2014": 1, "2015": 2, "2016": 3, "2017": 4, "2018": 5, "2019": 6, "2020": 7, "2021": 8 }, "label": { "2013": "2013", "2014": "2014", "2015": "2015", "2016": "2016", "2017": "2017", "2018": "2018", "2019": "2019", "2020": "2020", "2021": "2021" } } } }, "id": [ "unit", "coicop", "geo", "time" ], "size": [ 1, 1, 26, 9 ] } dzejson = json.dumps(json_data, indent = 4) print(dzejson)
Editor is loading...