Whay operator "&" on two (the same?) bool vectors give others result?

question

#1
julia> x=dni.==1;
julia> y=id_HH.==uid_HH[1];
julia> length(x)
334189
julia> length(y)
334189
julia> eltype(x)
Bool
julia> eltype(y)
Bool
julia> size(y)
(334189,)
julia> size(x)
(334189,)

Now please see on first record of result &

julia> x&y
334189-element BitArray{1}:
  true
 false
     ?
 false

julia> dni.==1&id_HH.==uid_HH[1]
334189-element BitArray{1}:
 false
 false
     ?
 false

Why ? first records:

julia>  dni.==1
334189-element BitArray{1}:
  true
  true
  true
....

julia> id_HH.==uid_HH[1]
334189-element BitArray{1}:
  true
 false
 false
...

Paul


#2

Please always quote your code using backticks (`) and provide a minimal example that can be executed, including example data (which can be just 1, 2 etc).


#3

Because & has higher precedence than .==. You need to add parentheses:
(dni.==1) & (id_HH.==uid_HH[1])