# Two separate vectors of same length and eliminating items in both vectors, whenever the values of those vectors are the same at identical columns. Depending on this the values of a third vector shall be eliminated accordingly

**URL:** <https://discourse.julialang.org/t/two-separate-vectors-of-same-length-and-eliminating-items-in-both-vectors-whenever-the-values-of-those-vectors-are-the-same-at-identical-columns-depending-on-this-the-values-of-a-third-vector-shall-be-eliminated-accordingly/94371>\
**Category:** Performance\
**Tags:** plotting, vector\
**Created:** [February 9, 2023, 7:26pm UTC](https://discourse.julialang.org/t/two-separate-vectors-of-same-length-and-eliminating-items-in-both-vectors-whenever-the-values-of-those-vectors-are-the-same-at-identical-columns-depending-on-this-the-values-of-a-third-vector-shall-be-eliminated-accordingly/94371 "2023-02-09T19:26:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ratwolf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ratwolf/32/46600_2.png) [@ratwolf](https://discourse.julialang.org/u/ratwolf)\
**Post date:** [February 9, 2023, 7:26pm UTC](https://discourse.julialang.org/t/two-separate-vectors-of-same-length-and-eliminating-items-in-both-vectors-whenever-the-values-of-those-vectors-are-the-same-at-identical-columns-depending-on-this-the-values-of-a-third-vector-shall-be-eliminated-accordingly/94371/1 "2023-02-09T19:26:01Z")

</div>

Two separate vectors of same length (but the lenghth can vary and is not predictable) and eliminating items in both vectors, whenever the values of those vectors are the same at identical columns. Depending on this the values of a third vector shall be eliminated accordingly

Sounds complicated but maybe a simple example self-explaining:

x = [0.1, 0.2, 0.3, 0.4, 0.5]  
y = [0.2, 0.3, 0.3, 0.4, 0.6]  
co = [0.7, 0.8, 0.9, 1.0, 1.1]

x’ = [0.1, 0.2, 0.5]  
y’ = [0.2, 0.3, 0.6]  
co’ = [0.7, 0.8, 1.1]

any idea to realize that?

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [February 9, 2023, 7:35pm UTC](https://discourse.julialang.org/t/two-separate-vectors-of-same-length-and-eliminating-items-in-both-vectors-whenever-the-values-of-those-vectors-are-the-same-at-identical-columns-depending-on-this-the-values-of-a-third-vector-shall-be-eliminated-accordingly/94371/2 "2023-02-09T19:35:24Z")

</div>

```julia
julia> idxs = x .!= y
5-element BitVector:
 1
 1
 0
 0
 1

julia> x[idxs]
3-element Vector{Float64}:
 0.1
 0.2
 0.5

julia> y[idxs]
3-element Vector{Float64}:
 0.2
 0.3
 0.6

julia> co[idxs]
3-element Vector{Float64}:
 0.7
 0.8
 1.1

```
