Sample without repeating string index

Hi all!

I’m randomly sampling from two master lists to create two shorter test lists in coder before my experiment starts. What I’m trying to do is not sample images that have the same index. So say I random.sample(List1, 2) to make negTest.

negTest = ["Stimuli/Faces/resized_neg_faces/AF01_AC.png,0.55,-1.5", "Stimuli/Faces/resized_neg_faces/AF06_AC.png,0.55,-1.5"]

Then I want to make the second list posTest from List2, but so images with AF01 and AF06 in the string don’t get sampled into that list.

I hope someone can provide a solution or point me in the right direction! Let me know if you need any more information.

Screen Shot 2022-10-17 at 2.41.17 PM

Screen Shot 2022-10-17 at 2.41.08 PM

I think what I’d do is have one list of lists


Shuffle the list and a separate list of 1s and 0s to select equal numbers of positive and negative faces without having both emotions for the same face.