I want to sum only the elements from the array out that have a value less than 0.49, but I'm not sure how to implement a filter for that criteria. Here is what I have so far:
def outcome(surveys,voters):
out = np.random.random((surveys,voters))
rep = [0]*surveys
for i in range(0,surveys):
rep[i] = sum(out[i,:])
return rep
Any help is greatly appreciated, Thanks in advance!