Jan-12-2019, 07:52 PM
(This post was last modified: Jan-12-2019, 07:52 PM by caroline_d_124.)
Hi everyone,
I'm very new to python and have been given some code to work with for a study I'll be conducting. There's just one section that I'm not quite understanding based on what I know about python so far. I've posted this section below.
What I'm not understanding is what's going on in the line below the note "initialize lists for hard coding...". Why would these lists be so long and written in this pattern if they're getting randomly shuffled?
The reason I want to understand this is that I want to figure out how to add a third soa time.
Thanks in advance for your help.
I'm very new to python and have been given some code to work with for a study I'll be conducting. There's just one section that I'm not quite understanding based on what I know about python so far. I've posted this section below.
What I'm not understanding is what's going on in the line below the note "initialize lists for hard coding...". Why would these lists be so long and written in this pattern if they're getting randomly shuffled?
The reason I want to understand this is that I want to figure out how to add a third soa time.
Thanks in advance for your help.
#define stimulus duration times fixscreen_time=.8 cue_time=.15 soa_short=.05 soa_long=.15 #initialise lists for hard coding side, soa and validity proportions #cueside - 0=left; 1=right; soa - 0=early; 1=late; validity - 0=valid; 1=invalid cueside=[0,0,1,1,1,0,1,1,0,0,0,1,0,1,1,0,0,1,1,0,0,0,1,1, 0,0,1,1,1,0,1,1,0,0,0,1,0,1,1,0,0,1,1,0,0,0,1,1, 0,0,1,1,1,0,1,1,0,0,0,1,0,1,1,0,0,1,1,0,0,0,1,1, 0,0,1,1,1,0,1,1,0,0,0,1,0,1,1,0,0,1,1,0,0,0,1,1, 0,0,1,1,1,0,1,1,0,0,0,1,0,1,1,0,0,1,1,0,0,0,1,1, 0,0,1,1,1,0,1,1,0,0,0,1,0,1,1,0,0,1,1,0,0,0,1,1, 0,0,1,1,1,0,1,1,0,0,0,1,0,1,1,0,0,1,1,0,0,0,1,1] soa=[1,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,1,0,1,0, 1,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,1,0,1,0, 1,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,1,0,1,0, 1,0,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,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