Saved variables per frame results in different lengths

I have 11 variables that are saved to the results file in my experiment, using the following format at the end of each routine:

thisExp.addData('zy_list', zy_list)

This outputs essentially an array in one cell in the .csv file, and works well most of the time. But 10-20% of the time, the resulting arrays are of different lengths, often by only a small number of elements (e.g., one has 16,821 elements and another has 16,830). This makes it hard to separate the array into rows.

Is there a known reason for why this happens?

We don’t know how you are generating zy_list, so without seeing that code, you are the only one who can currently answer the question…

Having said that, even if this issue is solved, saving such large amounts of data per trial might be stressing the .csv output option somewhat. If you notice performance or reliability issues, it might be worth exploring something more sophisticated and high-performance, such as the HDF-5 file format provided via ioHub.

zy_list is a variable from the routine; I save a few variables in that structure (thisExp.addData('variable', variable)) - the problem isn’t isolated to zy_list. It’s not consistent to length of time spent per participant (or total number of frames being saved to the csv). Regardless, thank you for your suggestion, I’ll check out ioHub.