psychopy.org | Reference | Downloads | Github

Data doesn't save correct

Version: Mac Catalina 10.15.3 …Psychopy v2020.1.2
Stand alone: yes
Hi, i tried to randomly shuffle the duration time (150 ms, 250 ms, 350 ms) of a blank text page within a loop. (I created a new routine within this loop for the component)
I used this code:
In the Begin Routine Tab.
from numpy.random import random, randint, normal, shuffle
jitters = [0.150,0.250,0.350]
shuffle(jitters)
current_jitter = jitters.pop()
thisExp.addData(‘jitter’, current_jitter)

and entered $ current_jitter for the duration time in my text component.

It seems to shuffle the times fine but my .xlsx data doesn’t seem to save the duration time from that for each trial properly.
Bildschirmfoto 2020-04-17 um 13.29.50

Shouldn’t there be a current_jitter column where it shows me which time was used?

Or shouldn’t there be entered a time for text_4.raw.stopped (this is the name of my text component).

It would be very nice if you could help me.
Greetings and thanks
Lisa

Am I right in assuming you’re using a code component in the builder interface?

Could you format your code as using the “preformatted text” option? That way, we can understand your code better.

We see only a part of the output file. The column might just be outside of your screenshot.
You save the current_jitter variable. Does that column show in your output?

I’m not sure, where the text_4.started_raw and text_4.started_mean variables are saved. In my output from a builder experiment (v2020.1.3), the builder would save text_4.started and text_4.ended for a component called text_4. I’ve inserted your code in an empty builder experiment: untitled.psyexp (6.3 KB).
Could you compile your script and check the line where your variables are saved and what they stand for?

You probably don’t need this line: from numpy.random import random, randint, normal, shuffle
You can check by compiling your builder script. These functions should be automatically imported by the builder in the first few lines.

N.b.: If you assign the jitters list at the beginning of every routine, you could potentially draw the same value multiple times. Is that the behaviour you want?

1 Like

Hi there, thanks for helping. No it didn’t show this row. I couldn’t get it to work and i had several naming issues to so i
created a complete new Experiment, trying not to use any code
I want to run it online Pavlovia later.

Thanks. Lisa