# Selecting parts of an array based on the conjunction of two conditions in v1

**URL:** <https://discourse.julialang.org/t/selecting-parts-of-an-array-based-on-the-conjunction-of-two-conditions-in-v1/24255>\
**Category:** General Usage\
**Tags:** question\
**Created:** [May 15, 2019, 7:27pm UTC](https://discourse.julialang.org/t/selecting-parts-of-an-array-based-on-the-conjunction-of-two-conditions-in-v1/24255 "2019-05-15T19:27:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhcooperman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jhcooperman/32/8466_2.png) [@jhcooperman](https://discourse.julialang.org/u/jhcooperman)\
**Post date:** [May 15, 2019, 7:27pm UTC](https://discourse.julialang.org/t/selecting-parts-of-an-array-based-on-the-conjunction-of-two-conditions-in-v1/24255/1 "2019-05-15T19:27:07Z")

</div>

I am updating some code from v0.6 to v1, and I have not been able to resolve one particular issue (except by workaround). In v0.6 my code included the construction

```julia
A[:,(A[1,:].==1) & (A[2,:].==10)]

```

for selecting the parts of the array A (of type Array{Int64,2}) based on the conjunction of two conditions. When I try to run this code in v1, I get the error message

```julia
MethodError: no method matching &(::BitArray{1}, ::BitArray{1})

```

followed by a suggestion for correcting the error, which I have been unable to implement. I would greatly appreciate assistance. Thanks.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [May 15, 2019, 7:30pm UTC](https://discourse.julialang.org/t/selecting-parts-of-an-array-based-on-the-conjunction-of-two-conditions-in-v1/24255/2 "2019-05-15T19:30:16Z")

</div>

Welcome! You just need to make the `&` elementwise with a `.&`:

```julia
A[:,(A[1,:].==1) .& (A[2,:].==10)]

```

In general,you’ll want to fix deprecations warnings in 0.6 before upgrading it — those warnings are there for a reason, and they’ll tell you exactly how to fix things like this! The transition version 0.7 will similarly be helpful for some other issues you may encounter.
