Tests from PrettyTables.jl
https://github.com/ronisbr/PrettyTables.jl/blob/master/test/general.jl
👀 Reading hidden code
👀 Reading hidden code
using Tables
👀 Reading hidden code
begin
end
Base.IndexStyle(::Type{A}) where {A<:TestVec} = Base.IndexCartesian()
end
👀 Reading hidden code
begin
struct MinimalTable
data::Matrix
end
Base.getproperty(x::MinimalTable, s::Symbol) = getindex(x, :, findfirst(==(s), Tables.columnnames(x)))
end
3×3 Matrix{Float64}:
0.212798 0.603537 0.429298
0.717627 0.0663684 0.959119
0.0334289 0.692403 0.473176
data = rand(3,3)
👀 Reading hidden code
3×3 Matrix{Float64}: 0.212798 0.603537 0.429298 0.717627 0.0663684 0.959119 0.0334289 0.692403 0.473176
Symbol("Col. 1")
Symbol("Col. 2")
Symbol("Col. 3")
mt = MinimalTable(data, [Symbol("Col. 1"), Symbol("Col. 2"), Symbol("Col. 3")])
👀 Reading hidden code
1
2
3
4
5
6
7
8
9
10
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
10.0
1
2
3
4
5
6
7
8
9
10
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
10.0
table = (A = Int64.(1:10),
B = Float64.(1:10),
C = Int64.(1:10),
D = Float64.(1:10))
👀 Reading hidden code
A | B | C | D | |
---|---|---|---|---|
Int64 | Float64 | Int64 | Float64 | |
1 | 1 | 1.0 | 1 | 1.0 |
2 | 2 | 2.0 | 2 | 2.0 |
3 | 3 | 3.0 | 3 | 3.0 |
4 | 4 | 4.0 | 4 | 4.0 |
5 | 5 | 5.0 | 5 | 5.0 |
6 | 6 | 6.0 | 6 | 6.0 |
7 | 7 | 7.0 | 7 | 7.0 |
8 | 8 | 8.0 | 8 | 8.0 |
9 | 9 | 9.0 | 9 | 9.0 |
10 | 10 | 10.0 | 10 | 10.0 |
t = Tables.rows(table)
👀 Reading hidden code
using DataFrames
👀 Reading hidden code
DataFrame
DataFrame
👀 Reading hidden code
"Tables.RowIterator{NamedTuple{(:A, :B, :C, :D), Tuple{Vector{Int64}, Vector{Float64}, Vector{Int64}, Vector{Float64}}}}((A = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], B = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], C = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], D = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]), 10)"
string(t)
👀 Reading hidden code
rowaccess(x::T) where T in Tables at /home/runner/.julia/packages/Tables/cRTb7/src/Tables.jl:338
@which Tables.rowaccess(t)
👀 Reading hidden code