storing data in a summary variable

56 views
Skip to first unread message

Marc Buehner

unread,
Apr 22, 2013, 9:16:09 AM4/22/13
to psychop...@googlegroups.com
Hi,
I want to store a variable that keeps track of the total number of correct responses in a trial handler.
This means I don't need to have multiple entries for this variable (i.e. one for each trial), but only one, kind of like the extraInfo dict.
At the moment I have
trials.data.add('TotalCorr',totalcorr)
 AFTER the trial handler loop.
Nonetheless, the datafile creates an array with all entries bar the last one being empty. The last one has the right value.
because my experiment has a variable number of trials depending on the participants performance (i.e. there is a time-out), this makes the analysis more messy than I want it to be

Is there a way to store a single variable with a trial handler?
Apologies if this is really obvious, but I couldn't find anything in the documentation or other posts.

Marc

Jonathan Peirce

unread,
Apr 23, 2013, 5:17:03 AM4/23/13
to psychop...@googlegroups.com
I'm confused. You said you wanted to store a single number, and that
you've achieved that (the last row has the value, and it's the correct
one). I haven't understood what you want to change. You mention the
extraInfo dict and you know you /could/ store your single value in there
if you like, right? Before you save the data just do
info['totalCorr']=totalCorr

Jon
> --
> You received this message because you are subscribed to the Google
> Groups "psychopy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to psychopy-user...@googlegroups.com.
> To post to this group, send email to psychop...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/psychopy-users/-/g49UY1bwf3gJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk/

Marc Bühner

unread,
Apr 23, 2013, 5:59:45 AM4/23/13
to psychop...@googlegroups.com
Hi Jon -- that's embarrassing. Yes, storying it in extraInfo is of course the obvious solution!
Marc
> You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/5BvQCcOv5MQ/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.
> To post to this group, send email to psychop...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages