Empty lines in csv with nested loops

75 views
Skip to first unread message

Andrey Chetverikov

unread,
Mar 12, 2013, 6:53:34 AM3/12/13
to psychop...@googlegroups.com
Hi! 

I'm not sure, whether it is a bug or I am doing something wrong. I am running an experiment that utilizes nested loops. All is fine except that in the generated csv there is an extra line after each pass of the main loop that contains only main loop info and experiment info. Please, see the attached files for the minimal example (I've added .txt to .psyexp to get rid of error 340 from google). Although it is not a problem to remove these lines after experiment, I wonder if it is possible to get rid of them beforehand. 

In addition, I wonder, if it is possible to repeat answers from routines in main loop on each line of nested loop, like it is done with trial number. 

I use PsychoPy 1.76 under Linux.

All the best,
Andrey
_2013_Mar_12_1429.csv
untitled.psyexp.txt

Jonathan Peirce

unread,
Apr 19, 2013, 9:20:47 AM4/19/13
to psychop...@googlegroups.com
Right now there isn't a way to do these things using the GUI. I think
both of these aspects can be achieved with tiny modification to the
generated script though. In your study there will be two places where
the command
thisExp.nextEntry()
is called. That line indicates that the data file should advance to the
next line and consider all future events to be part of the nex 'entry'
(e.g. next trial, next epoch.... whatever makes sense for your study).
If you delete the second one, which should be related to your outer
loop, then I think you'll get the results you expect.

I guess this is something we should add to loops in the Builder GUI; a
checkbox called "Advance data output" (better name anyone?) with a
default of True. If set to False the `thisExp.nextEntry()` should not be
inserted in the script. People on the developers list know I hate
over-engineering though. So I wonder how the useful/confusing trade-off
goes for this feature...

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/-/Y71hq9yKJ6MJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

Lew Harvey

unread,
Nov 10, 2013, 1:28:04 AM11/10/13
to psychop...@googlegroups.com
I would find a way to suppress the thisExp.nextEntry() command on the outer loop extremely useful. I find the "extra" line in the csv data file after each pass through the outer loop very annoying. It means I have to do extra work when reading the file into R to make sure that there are no NAs in the data frame that could cause trouble when analyzing the data. Although the manual removal of the nextEntry() command from the script does work, to remember to do it each time you make a change in the builder is really a burden. A check box write data at end of loop in the loop dialog would be satisfactory. Then you could just check the inner-most loop and not get these extra lines
Reply all
Reply to author
Forward
0 new messages