Hi, Basically I want to put my responses for each of the outputs of my loop (answers yes or no to different contrast numbers) into an empty list ... so I would have a list for each contrast corresponding to how many yes or no's there were?
from observerClass import observer
obs1 = observer(0.2, 0.05)
obs2 = observer(0.1,0.05)
for cont in numpy.linspace(0.0,1.0,10):
print 'cont is', cont
for repN in range(10):
print cont, obs1.getResponse(cont) <--- this generates a yes or no to the cont
print(sum(obs1.getResponse(cont) == 'yes' for cont in numpy.linspace(0.0, 1.0, 10)))
Thanks, that works for part of what I want but I dont think I was very clear. I have set it so that I get a yes or no answer to each contrast. I want to store the amount of yes and no's for each contrast in a list ... if that makes any sense?
So I would get something like ... Contrast 0.2 (yes 8, no 10)
Contrast 0.5 (yes 10, no 1)
""observer class to be imported by other scripts
def __init__(self, thresh, noise):
def getResponse(self, contrast):
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...