Hi all,

I am trying to get the code I have working with PsychoPy3. The code was written using python and psychopy2 and with PyQt4. Now I have PsychoPy3 and PyQt5. Apperantly getting things work with PyQt5 is not really straitforward. Anyway, I have accomplished some. Now, I have an error as below:
Any idea how to solve this?

experiment = Experiment(windowColor, markerNames, dataFromSubject, popupBetween, popupEnd, blocks, blockTextToDisplay, dbFile, dbTables, test, fileToUseToCalculateAverage = fileToUseToCalculateAverage)

coordinates = MovieStimulusCoordinates(fileToUseToCalculateAverage['file'], fileToUseToCalculateAverage['numberOfDotsPerFrame'], fileToUseToCalculateAverage['matrixAlreadyNormalized'])

self.__projectionMatrix = self.makeProjectionMatrix()

return int(projectionMatrix.reshape(projectionMatrix.shape[0] / self.numberOfDotsPerFrame, self.numberOfDotsPerFrame, 2))
TypeError: 'float' object cannot be interpreted as an integer

I know nothing about the package you are using, but since the problem is with a conversion you could try taking

return int(projectionMatrix.reshape(projectionMatrix.shape[0] / self.numberOfDotsPerFrame, self.numberOfDotsPerFrame, 2))

and break it down into components like

a = projectionMatrix.shape[0]
b = self.numberOfDotsPerFrame
c = projectionMatrix.reshape((a/b, b, 2)

print("a=",a,"type=",type(a))
print("b=",b,"type=",type(b))
print("c=",c,"type=",type(c))

return int(projectionMatrix.reshape(a / b, b, 2))   

That might give you more information on the exact problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.