I have a list (called temp
) of DataFrames where I want to save each DataFrame in a unique JSON File and give the file the name as the string value in the DataFrame column 'symbol'.
My approach is:
temp[i].to_json(temp[i][[temp[i]['symbol']] + '.txt') for i in
temp.symbol.unique()
But I get the following error:
SyntaxError: invalid syntax