Using the PsychoPy builder, I’m trying to create a stimuli that consists of 100 lines that are randomly positioned with orientations sampled from a gaussian distribution. I’m trying to set up the values for the position (pos) and orientations (ori) using the the builder’s coding window; here is the script I use:
ori =  pos =  for i_ori in range(100): ori.append(random.gauss(mu, sigma)) x = np.random.uniform(-0.1, 0.1, 100) for i_pos in range(100): y = [np.random.uniform(-0.1, 0.1), x[i_pos]] pos.append(y)
I’m getting the error message:
File "C:\Users\r02mj20\AppData\Local\PsychoPy3\lib\site-packages\psychopy\tools\monitorunittools.py", line 69, in _height2pix return (pos + vertices) * win.size ValueError: operands could not be broadcast together with shapes (100,2) (4,2,100)
I’m new to python (and coding in general), so I’m not sure where the values (100,2) (4,2,100) are coming from. I’ve tried editing the code (e.g., removing the orientations or removing the positions) to see if I could work it out, but it doesn’t seem to matter what I do, I get the same error message each time. Any help would be greatly appreciated- thanks.