Shuffle blocks in loop
Hi everyone!
I have an experiment which I need to shuffle blocks in loop object code. Thing is that I have an array of length 200 values. I need to shuffle only 50 at one in the block, e.g. first block 50 shuffled, second block 50 shuffled values.
I found a that I can shuffle a column in the loop by calling shuffle <name_of_collumn> and slice index1 index2. I though I could run something like:
slice 0 49
shuffle <name_of_column>
slice 50 99
shuffle <name_of_column>
slice 100 149
shuffle <name_of_column>
slice 150 199
shuffle <name_of_column>
But this is not working since I don't have any chance to "reset" the slice I have done before. Is there any way how could I shuffle only specified blocks, not the entire column?
Thank you very much!
Michael

Comments
Hi Michael,
The
sliceoperation takes a slice and discards all other rows, so that's definitely not what you want.The easiest solution is probably to add a column, say
block, and use this to label the blocks. And then you usesortby blockto make sure that the block order is preserved, while shuffling the rows within a block.Would that work?
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thank you Sebastiaan very much it worked like a charm!