# Querying the index of the tuple in a list

**URL:** <https://discourse.julialang.org/t/querying-the-index-of-the-tuple-in-a-list/3387>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [April 26, 2017, 4:15pm UTC](https://discourse.julialang.org/t/querying-the-index-of-the-tuple-in-a-list/3387 "2017-04-26T16:15:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![varun7rs](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@varun7rs](https://discourse.julialang.org/u/varun7rs)\
**Post date:** [April 26, 2017, 4:15pm UTC](https://discourse.julialang.org/t/querying-the-index-of-the-tuple-in-a-list/3387/1 "2017-04-26T16:15:23Z")

</div>

I have an array of tuples representing the edges of a graph. I would now want to obtain the index of the tuple in the array. I’ve been using findin(myarray, (s,d)) but I get a zero element array despite the tuple being present in the array. Is there a way to get the index of the tuple in an array?

Thanks

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [April 26, 2017, 4:22pm UTC](https://discourse.julialang.org/t/querying-the-index-of-the-tuple-in-a-list/3387/2 "2017-04-26T16:22:56Z")

</div>

The second argument of `findin` is a collection of keys you want to find as documented so you are looking for `s` and `d` in the array and not `(s, d)`. `((s, d),)` should work. There’s also `findfirst`, `findnext` etc.

---

<div class="post-metadata">

**Author:** ![varun7rs](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@varun7rs](https://discourse.julialang.org/u/varun7rs)\
**Post date:** [April 26, 2017, 4:24pm UTC](https://discourse.julialang.org/t/querying-the-index-of-the-tuple-in-a-list/3387/3 "2017-04-26T16:24:40Z")

</div>

That worked perfect. Thanks a lot @yuyichao
