I have a CSV file whose first line contains the names of the variables, and the remaining lines contain the data. What a good way to split it into files containing only one variable in Python? Will this solution be reliable? For instance. What if the input file is 100G in size? I am trying to follow a dividend strategy, but new to Python. Thanks in advance for your help!
The input files look like
var1,var2,var3
1,2,hello
2,5,yay
...
I want to create 3 (or as many variables as you like) files var1.csv, var2.csv, var3.csv so that the files resemble
File1
var1
1
2
...
File2
var2
2
5
...
file3
var3
hello
yay
source
share