addData

211 views
Skip to first unread message

Aysja Johnson

unread,
Oct 2, 2015, 5:20:20 PM10/2/15
to psychopy-users
Is there any reason that thisExp.addData('just checking', 5) wouldn't work? I didn't change anything in the setup of thisExp (I left it as what psychopy automatically created). When I look at the csv file it adds the header "just checking" but doesn't associate the value 5 with it. I've tried lists and numbers. Any thoughts?

Thanks!

Michael MacAskill

unread,
Oct 3, 2015, 5:12:51 PM10/3/15
to psychop...@googlegroups.com

> On 3/10/2015, at 10:20, Aysja Johnson <aysjaj...@gmail.com> wrote:
>
> Is there any reason that thisExp.addData('just checking', 5) wouldn't work? I didn't change anything in the setup of thisExp (I left it as what psychopy automatically created). When I look at the csv file it adds the header "just checking" but doesn't associate the value 5 with it. I've tried lists and numbers. Any thoughts?

Hi,

— Where/when do you do this? If it isn't on every trial (e.g. just at the end of the experiment), there will be blank cells.

— What happens if you don't have a space in the column name. e.g.
thisExp.addData('justChecking', 5)

Regards,

Michael

Aysja Johnson

unread,
Oct 3, 2015, 7:10:56 PM10/3/15
to psychopy-users
Hi Michael,
Thanks for the quick response. Originally I was doing it in the 'End Routine Trial' section of code but I've tried it in multiple places now; before the experiment starts, every time a key press is updated. and right before the experiment ends. I also tried deleting the space. Nothing has changed -- it still adds the header every time but not the value associated with it. 

Michael MacAskill

unread,
Oct 3, 2015, 7:46:48 PM10/3/15
to psychop...@googlegroups.com

>> Is there any reason that thisExp.addData('just checking', 5) wouldn't work? I didn't change anything in the setup of thisExp (I left it as what psychopy automatically created). When I look at the csv file it adds the header "just checking" but doesn't associate the value 5 with it. I've tried lists and numbers. Any thoughts?

Just tested, and it works fine for me on the latest release. Would have been surprised if this was broken, as it would affect many people. So it will have to be something unique to you.

Are you sure there isn't any code elsewhere which could be saving blank values to this variable, which could over-write the '5'?

Perhaps you should click the "Compile script" button and search for all instances of "Just checking" to see if anything unexpected is happening (ideally, it should appear only once).

Regards,

Michael

--
Michael R. MacAskill, PhD 66 Stewart St
Research Director, Christchurch 8011
New Zealand Brain Research Institute NEW ZEALAND

Senior Research Fellow, michael....@nzbri.org
Te Whare Wānanga o Otāgo, Otautahi Ph: +64 3 3786 072
University of Otago, Christchurch http://www.nzbri.org/macaskill

Jeremy Gray

unread,
Oct 3, 2015, 8:52:34 PM10/3/15
to psychop...@googlegroups.com
It works for me too, but I see it not work in some conditions.

It did not work if I made an experiment and the only thing in the experiment was a code component with the code to do thisExp.addData(). There I get a column but not the data value (5). But if I add a keyboard response to the experiment, then the 5 also shows up in the data file.

Instead of the keyboard component, if the code in the code component also contains "thisExp.nextEntry()" (no quotes) after doing the addData, then it also works.

--Jeremy


--
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/msgid/psychopy-users/7B0EAEBC-1C68-4C91-A0FE-0B7F5D0ADD1F%40nzbri.org.
For more options, visit https://groups.google.com/d/optout.

Aysja Johnson

unread,
Oct 6, 2015, 6:09:56 PM10/6/15
to psychop...@googlegroups.com
Hi Jeremy,
Thank you so much! I added thisExp.nextEntry() after calling addData and it works perfectly. 

--
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/fUrx5YQo-tU/unsubscribe.
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