When exporting my json into a csv, using df.to_csv('codetocsv.csv', index=False), my csv format groups my 'series' column into one individual column. Im trying to have each string in its own column ie, a column for command, copyright etc, and a column for each year. There are multiple countries within the json.
{
"request": {
"command": "series",
},
"series": [
{
"f": "A",
"copyright": "None",
"updated": "2022",
"data": [
[
"2021",
404.800507146
],
[
"2020",
371.59497253
],
[
"2019",
392.433272519
],
[
"2018",
397.800544326
]
]
}
]
}
df = pd.concat(dfs, ignore_index=True)
data = df['series'][0]['data']
for row in data:
year = row[0]
value = row[1]
print(f'Year: {year}, Value: {value}')