creating train/test csv files out of a original csv file for 10 fold cross validation experiment : I have a csv file (main.csv) that has a unique column ID that also pertains to my image names (minus their .jpg extension). 

I want to do 10 fold cross-validation and create train and test CSV such that test csv for each fold would only contain 10 percent of the original CSV.

Is there a straighforward path (already done) to this? 

Basically, I want my eventual train and test csv files to have the same exact column names but designed such that I could perform 10 fold cross validation with them (aka randomly sampled/shuffled and 10% selected). 

I don't mind pandas in Python or R. 