I am exporting some info to csv files. I am using the following code:
for i, g in df.sort_values("date").groupby("country", sort=False):
if Curency == 'USD':
g.to_csv('{}_USD.csv'.format(i))
else:
g.to_csv('{}_NK.csv'.format(i))
When I open the csv files I get the csv files; but in just one column.
I would like to get the information, contained in each csv file, separated by columns (using comma to separate the information) like this.
I followed the documentation stated here but I couldn´t get my desire output.
Any help would be appreciated. Thanks