| Reference | Downloads | Github

"NaN" appears when using spacebar to denote empty cell in pavlovia

Hello everyone. I’m a graduate student trying to code her masters project and I’m struggling. I am trying to create a sternberg-like memory task where participants will see a list of words (vertically) and then see a probe where they have to decide if the word was in the list or was not. I have varying set sizes of 4,6, and 8 words. I currently have it set up where each word is represented by a cell in excel (screenshot below) and then a corresponding text item for each word. When there are only 4 or 6 words I put spaces into the corresponding cells in excel and it works perfect locally (psychopy on my Mac). However, when I sync to pavlovia, I get “NaN” where the spaces are in the excel file. How can I get a blank to show when there are less words than spots? Should I be setting this up a different way? Any help would be greatly appreciated.

I think I recognise this bug - we were having issues recently with blank text components appearing as NaN because of differences in how PsychoPy handles blank values between Python and JS. I put in a bug fix for it in version 2020.2.5, so if you update your PsychoPy version then sync your experiment again it should compile correctly. Let me know if it doesn’t!

Thank you for the response! The URL to my study for reference is Now, it runs locally fine but when uploading to pavlovia I am stuck on the initializing screen. Wnen I opened the console, the error I was getting is Uncaught SyntaxError: Unexpected token ‘,’. I am unsure what this means.

Ah this was my mistake - I do have a fix in but it’s not in 2020.2.5, it’ll be in the next release (hopefully soon). For the time being, just putting a placeholder bit of text like a full stop is probably the best method.

Can you go more in depth about that means? Thank you for your help!

We noticed that blank Text components weren’t working in Pavlovia some time between versions 2020.2.4 and 2020.2.5, so I fixed it and thought the fix was in 2020.2.5 but we missed it, so it will be in 2020.2.6 instead (which should be out in the next few days).

Sorry, I meant about adding a full stop place holder? I’m still pretty new to coding. Thank you!


Oh I see! Sorry, by that I mean set the value of blank cells in the excel sheet to be a full stop rather than blank.

Will I need to restructure how I’m giving the words to the participants? I want the list of words to be vertical not horizontal so each word is in a separate cell. How would I incorporate a full stop to help? Thank you!!

Hi @TParsons, I went ahead and replaced all spaces with a period, even though I’m not super happy with how that looks when shown to the participants it works for now. However, when I try running on Pavlovia I still get the same error. I have checked all the code I hand wrote but still isn’t working.

The long term fix for this should be in the standalone version now, could you try updating to this version and see if you still get the error?

If you do, could you share the .py and .js files generated in the same folder as the experiment when you try to run it?

Hello! Thank you, it now runs on psychopy and pavlovia but still shows NaN when ran on pavlovia. metaFile.xlsx (8.6 KB) OApractice.psyexp (137.3 KB) practice1.xlsx (13.1 KB) practice2.xlsx (12.7 KB)

It says the .js files are not authorized to be uploaded.