TypeError: non-boolean (BitArray{1}) used in boolean context

This is exactly the same as the answer in MethodError: no method matching -(::Int64, ::Array{Float64,1}) - #3 by aaron.

ifelse works on scalars so if you want to do it elementwise use the dot syntax, ifelse.(...).

2 Likes