# Indexin() for two identical vectors

**URL:** <https://discourse.julialang.org/t/indexin-for-two-identical-vectors/13353>\
**Category:** New to Julia\
**Created:** [August 13, 2018, 9:57am UTC](https://discourse.julialang.org/t/indexin-for-two-identical-vectors/13353 "2018-08-13T09:57:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![moesphere](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moesphere/32/3348_2.png) [@moesphere](https://discourse.julialang.org/u/moesphere)\
**Post date:** [August 13, 2018, 9:57am UTC](https://discourse.julialang.org/t/indexin-for-two-identical-vectors/13353/1 "2018-08-13T09:57:25Z")

</div>

According to the documentation, `indexin(a,b)` should return the first index in `b` for each value in `a`.

```julia
a = [5,2,5]
indexin(a,a)

```

returns `[3,2,3]`. Shouldn’t it return `[1,2,1]`?

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [August 13, 2018, 10:12am UTC](https://discourse.julialang.org/t/indexin-for-two-identical-vectors/13353/2 "2018-08-13T10:12:33Z")

</div>

Which julia version are you on? I get the expected behaviour on 0.7/1.0. On 0.6.4 I get the behaviour you see.

---

<div class="post-metadata">

**Author:** ![moesphere](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moesphere/32/3348_2.png) [@moesphere](https://discourse.julialang.org/u/moesphere)\
**Post date:** [August 13, 2018, 1:19pm UTC](https://discourse.julialang.org/t/indexin-for-two-identical-vectors/13353/3 "2018-08-13T13:19:50Z")

</div>

Then it should be solved (I am on 0.6.4). 😉

Thanks!
