I believe in this exercise you need to go through all the elements of the array and if that element is bigger or equal to 0.5 then make it a 1 otherwise 0. You can do that with a for loop or a list comprehension! Not in the way you are doing it here.
The error says your f_wb value is not a scalar.