If you want to select 10 random rows for the first loop and then select the same rows next time then one option would be to append the current index to a list during the first loop and use that list as the selected rows for the second.
Have a look at my Repeat Subset demo PsychoPy Online Demos