N dimensional array with different type

Yes, you can have an Array{Any, N}:

julia> rand([1.0, true, "x"], 3, 3, 3)
3×3×3 Array{Any, 3}:
[:, :, 1] =
 true     true  true
     "x"  true     1.0
    1.0   true     1.0

[:, :, 2] =
  "x"     1.0       "x"
 1.0   true     true
  "x"      "x"      "x"

[:, :, 3] =
 1.0      1.0  true
 1.0      1.0     1.0
  "x"  true       1.0

whether that’s a good idea is a different question - certainly not if you are using this in any performance critical code.

Maybe it’s an artefact of your drawing but your image looks like a table rather than a multidimensional array (maybe what people sometimes call a “long format” table), maybe a DataFrame works for you:

julia> using DataFrames

julia> DataFrame(id = [1,1,1,2,2,2], i = [1:3; 1:3], P1 = rand(6), check_ev = rand(Bool, 6))
6×4 DataFrame
 Row │ id     i      P1         check_ev
     │ Int64  Int64  Float64    Bool
─────┼───────────────────────────────────
   1 │     1      1  0.761151       true
   2 │     1      2  0.946944      false
   3 │     1      3  0.633906      false
   4 │     2      1  0.696095      false
   5 │     2      2  0.87252       false
   6 │     2      3  0.0642857      true
3 Likes