I thought that I could make a Term.Table out of a DataFrame directly since DataFrames conform to the Tables.jl interface. However, it did not work, and I have to manually redefine the header after converting.
julia> using DataFrames, Term
julia> table = DataFrame(x = 1:3, y = ["A","B","C"])
3×2 DataFrame
Row │ x y
│ Int64 String
─────┼───────────────
1 │ 1 A
2 │ 2 B
3 │ 3 C
julia> Term.Table(
table,
style="red",
)
ERROR: MethodError: no method matching Term.Tables.Table(::DataFrame; style::String)
julia> Term.Table(
Matrix(table),
style="red",
)
╷
Column1 │ Column2
╺━━━━━━━━━━━┿━━━━━━━━━━━╸
1 │ A
╶───────────┼───────────╴
2 │ B
╶───────────┼───────────╴
3 │ C
I thought that I could make a
Term.Table
out of a DataFrame directly since DataFrames conform to the Tables.jl interface. However, it did not work, and I have to manually redefine the header after converting.