# Finding the index where the values in one array are greater than the values in another array

**URL:** <https://discourse.julialang.org/t/finding-the-index-where-the-values-in-one-array-are-greater-than-the-values-in-another-array/42485>\
**Category:** New to Julia\
**Created:** [July 3, 2020, 5:48pm UTC](https://discourse.julialang.org/t/finding-the-index-where-the-values-in-one-array-are-greater-than-the-values-in-another-array/42485 "2020-07-03T17:48:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nash](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nash/32/14482_2.png) [@Nash](https://discourse.julialang.org/u/Nash)\
**Post date:** [July 3, 2020, 5:48pm UTC](https://discourse.julialang.org/t/finding-the-index-where-the-values-in-one-array-are-greater-than-the-values-in-another-array/42485/1 "2020-07-03T17:48:52Z")

</div>

I need to find the index of all instances where the values in one array (A, say) is larger than the corresponding values in another array (B, say, with B having the same length as A).

What is the best practice way to solve that problem in Julia?

---

<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:** [July 3, 2020, 5:51pm UTC](https://discourse.julialang.org/t/finding-the-index-where-the-values-in-one-array-are-greater-than-the-values-in-another-array/42485/2 "2020-07-03T17:51:38Z")

</div>

`findall(A .> B)`

---

<div class="post-metadata">

**Author:** ![Nash](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nash/32/14482_2.png) [@Nash](https://discourse.julialang.org/u/Nash)\
**Post date:** [July 3, 2020, 5:58pm UTC](https://discourse.julialang.org/t/finding-the-index-where-the-values-in-one-array-are-greater-than-the-values-in-another-array/42485/4 "2020-07-03T17:58:19Z")

</div>

Thank you. Very succinct.
