Skip to content

Instantly share code, notes, and snippets.

@benwhalley
Created February 18, 2020 17:19
Show Gist options
  • Save benwhalley/2dce207ebc8caa0d1cfea85395a702ae to your computer and use it in GitHub Desktop.
Save benwhalley/2dce207ebc8caa0d1cfea85395a702ae to your computer and use it in GitHub Desktop.
import random
import pandas as pd
def randomisesims():
stimA = list(range(1,91))
stimB = list(range(91,131))
random.shuffle(stimA)
random.shuffle(stimB)
return stimA[:40]+stimB[:20]
N = 20
for i in range(1, N+1):
df = pd.DataFrame()
df['stim'] =randomisesims()
df.to_csv(f"participant_{i}.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment