# Find in in Julai 1.0 .. LinearIndices to long

**URL:** <https://discourse.julialang.org/t/find-in-in-julai-1-0-linearindices-to-long/33674>\
**Category:** General Usage\
**Created:** [January 22, 2020, 7:36pm UTC](https://discourse.julialang.org/t/find-in-in-julai-1-0-linearindices-to-long/33674 "2020-01-22T19:36:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![programista](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/programista/32/5372_2.png) [@programista](https://discourse.julialang.org/u/programista)\
**Post date:** [January 22, 2020, 7:36pm UTC](https://discourse.julialang.org/t/find-in-in-julai-1-0-linearindices-to-long/33674/1 "2020-01-22T19:36:44Z")

</div>

in vector los i need to find some ones  
new code of julai is some comlicated :  
`(LinearIndices(los.==1))[findall(los.==1)]`

Is some more easy to do ?  
Paul

---

<div class="post-metadata">

**Author:** ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Post date:** [January 22, 2020, 7:41pm UTC](https://discourse.julialang.org/t/find-in-in-julai-1-0-linearindices-to-long/33674/2 "2020-01-22T19:41:50Z")

</div>

I may not have understood the problem but

```julia
los = [Int(rand()<0.5) for i in 1:10_000];
idx_1 = findall(los .== 1); # indices of where the `1` are

```

This gives the same result as `(LinearIndices(los.==1))[findall(los.==1)]` .

---

<div class="post-metadata">

**Author:** ![programista](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/programista/32/5372_2.png) [@programista](https://discourse.julialang.org/u/programista)\
**Post date:** [January 23, 2020, 2:55pm UTC](https://discourse.julialang.org/t/find-in-in-julai-1-0-linearindices-to-long/33674/3 "2020-01-23T14:55:46Z")

</div>

The

```julia
(LinearIndices(los.==1))[findall(los.==1)

```

is in hint in Julia 0.7, but is to looong 🙂

Thx Paul

---

<div class="post-metadata">

**Author:** ![roble](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roble/32/12303_2.png) [@roble](https://discourse.julialang.org/u/roble)\
**Post date:** [January 23, 2020, 3:57pm UTC](https://discourse.julialang.org/t/find-in-in-julai-1-0-linearindices-to-long/33674/4 "2020-01-23T15:57:49Z")

</div>

I myself are new to julia, but perhaps logical indexing would be an option if you need the indices just once.

```julia
los[los.==1] .= something
#or
other_similar_length[los.==1] .= something

```
