I can't figure out how to obtain this behavior:
From this matrix:
julia> a = [1 1 1; 1 1 1; 1 1 2]
3×3 Array{Int64,2}:
1 1 1
1 1 1
1 1 2
I want to change all the 1s to 5s but only in the last row.
What I did is a[3, :][a[3, :] .== 1] .= 5 but the value of a isn't changed.
I've noticed that with:
foo[foo .== 1] .= 5
a[3, :] = foo
It works, but I'm trying to reduce allocations and this should be removed.
Thanks in advance