How to create columns in a loop

I also don’t know anything about Dataset but this should do the same thing as your code:

function demo_data()
    n = 100000
    m = 8
    time = 0.1:0.1:n*0.1
    addr = rand(Int16(0x101):Int16(0x12e), n)
    columns = (Symbol("d", i) => rand(UInt8, n) for i in 1:m)
    ds = Dataset(;time, addr, columns...)
    ds.addr[5] = missing
    ds
end
2 Likes