I have a variable that is a vector of 0’s, but when I try to change an element within the vector then it won’t update. I can update the code via Spyder, so I know the code works (just not in psychoPY).
nTrial = 0
vec_rewards = 
for i in range(nTotalTrial):
vec_rewards = vec_rewards+
if trial_key.keys == 1:
vec_rewards[nTrial+opt_one_delay] = vec_rewards[nTrial+opt_one_delay]+opt_one_reward
elif trial_key.keys == 0:
vec_rewards[nTrial+opt_one_delay] = vec_rewards[nTrial+opt_two_delay]+opt_two_reward
I also have the variables for opt_one*, I don’t think it is necessary to share that code though. Let me know if you need it! Thank you!