**Excel file not being read properly/Digit Span**

OS Version: Windows 10
PsychoPy version 2022.24

Hello! I’m very new to Psychopy but I’ve recently been struggling with creating my digit span task, specifically, Psychopy is not reading numbers in my excel file properly according to how it’s organized on the excel sheet. For example, within my loop I have a digit span routine that specifies the specific sequence of numbers I want to appear, and a recall routine.

Main issue: Even though my text stimuli within the digit span routine specify that I want sequence 1 read ($s1), it does not do that when I run the experiment. Instead of reading the two digits (1 & 7), it reads four unrelated digits. It does this for all the other sequences, and I’m not sure why. I’ve specified four sequences out of 16 that I want read, and for some reason the loop doesn’t terminate so that the participant can proceed to the survey questions in my experiment.

I’ve tried reading and watching the limited # of videos that exist on this topic, but I don’t understand. Is it possible to solve this without using code? I’m working in builder mode. I’ve included some pictures to show how I’ve set up the text stimuli to specify the sequences and the loop properties which is connected to the excel file. I will try to see if I can post a picture of the excel sheet in a comment.

Any help would be appreciated. I’m sure the solution is rather simple, but keep in mind I am very new to this program. Thank you!


My excel sheet

Hi @Filmologia, I don’t exactly know where the random digits come from, but from looking at your xlsx I think you are making this way more complicated and error-prone than it has to be (e.g., having different sequences in different columns). Attached you find a minimal example of how this could work with two loops around a digit and a response routine. Let me know if you have any questions!

digitspan.zip (20.9 KB)

@ajus Hi, thank you for the attachment. I’m going to take a look, and I’ll try this out to see if it fixes any of the issues. It seems like the digits were from the excel sheet but not in the sequential order according to each sequence in that column.

I noticed there are three excel sheets here, two of them specifying the numbers from the sequences and the other one specifying the excel file name. Will this sort of setup be practical with various sequences? I was supposed to have 16, but I just want to make sure that more sequences won’t make the output look messy/confusing to read. Thank you!

Yes, adding more sequences is simply a matter of adding more xlsx files with the required digits and adding the file name to the sequences.xlsx. You can set the inner loop to „sequential“ to have the digits in the correct order. As long as „is trials“ is checked for the outer loop and not for the inner loop, the data output should be as clean as it can be, with one row for a sequence and it’s response. If you want to you can also add more descriptive variables (columns) to sequences.xlsx, which specify e.g. the length of the sequence or the numbers entailed.

@ajus Thanks for clarifying. I followed your example and set it up that way, although I have run into a problem: my experiment crashes when the participant gets to the loop (digit span) portion. I’m not sure why, but I can provide some information to see if you might have an idea.

I have 16 excel files, one for each span of numbers. I also have another excel file that specifies the name of each file in it. When the experiment crashes, I look at the psychopy runner box and see that it says “ValueError: Conditions file not found: C:\Users\edwin\Downloads\Seq1NEW.xlsx”. Attached to this reply is a screenshot of an example of my digit span from one excel sheet, the excel file for the outer loop. I’ll have to attach the screenshot of the properties for the inner and outer loops in a separate comment.


But if the Psychopy runner is right, then for some reason my “Seq1NEW.xlsx” which contains the first sequence of numbers, isn’t being found even though it’s saved to my computer. I’m not sure why this is. Any ideas? Thank you.

Properties for the inner and outer loops:


Text properties for digits:

It’s important that all of your xlsx files are in the folder as your experiment. Is this the case? Could you show a screenshot of your folder?

Right, so this is the folder:

I guess I would just need to drag my experiment file in there? I just don’t understand why it would say it wasn’t able to read one of the files.

Yes, everything has to be in the same folder. PsychoPy fails to read the first, so this the error you get. It would also not find the others.