Skip to content
Advertisement

exporting DF to csv with variable file names

I would like to keep this same code but adjust the .to_csv section to save a variable repeating file name

JavaScript

I would like the names of the exported files to look like this…I think I need some sort of loop?

Period 1 layer 1.csv

Period 1 layer 2.csv

Period 1 layer 3.csv

Period 1 layer 4.csv

Period 1 layer 5.csv

Period 2 layer 1.csv

Period 2 layer 2.csv

Period 2 layer 3.csv

Period 2 layer 4.csv

Period 2 layer 5.csv

Period 3 layer 1.csv

And so on….till the loop ends

Advertisement

Answer

JavaScript

You can try this one out.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement