Skip to content

Instantly share code, notes, and snippets.

@janfreyberg
Created October 14, 2016 08:27
Show Gist options
  • Save janfreyberg/fece6b94493e66f5d98644fcc9ff9037 to your computer and use it in GitHub Desktop.
Save janfreyberg/fece6b94493e66f5d98644fcc9ff9037 to your computer and use it in GitHub Desktop.
from psychopy import data
import random
stairs = data.MultiStairHandler(conditions=[{'label': str(size),
'size': size,
'startVal': 10,
'stepType': 'lin',
'nTrials': 20,
'nUp': 1,
'nDown': 1,
'minVal': 1,
'maxVal': 199,
'stepSizes': 1}
for size in range(4)],
nTrials=80,
method='random',
stairType='simple')
for difficulty, condition in stairs:
stairs.addResponse(random.choice([0, 1]))
stairs.saveAsExcel(fileName='stair',
fileCollisionMethod='rename')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment