Hello, I am getting some strange behaviour in a loop which is reading some columns from a table and converting it to an array. The loop seems to exit after the first iteration. I have given a simple example below. If I check the table Subset
and the array ArrayX
they show values for the when i.Scenario == 1
,whereas I would have expected it show values of either the last iteration i.e. i.Scenario == 2
or for all iterations.
Am I missing anything? Is there a way to update the values in the table and array?
using JuliaDB
using Tables
DataT = table([1,1,1,1,1,2,2,2], [1,2,3,4,5,1,2,3], [10,15,100,115,101,10,15,100],[210,215,1200,1215,101,210,215,1200],[310,415,3100,1315,101,310,415,3100],[410,15,4100,4115,1401,410,15,410],[510,515,1500,5115,5101,510,515,1500]; names = [:Scenario, :ID, :T1, :T2, :T3, :T4, :T5])
for k = 1:2
Subset = select(filter(i -> (i.Scenario == k), DataT), All(Between(:T1, :T5)))
ArrayX = Tables.matrix(Subset)
end