I was wondering what the difference is between the Symbol type and Sym type in dataframe in Julia. Here is an example with Symbol which is defined with ::
julia> using DataFrames
julia> df = DataFrame(V1 = [:True, :False])
2×1 DataFrame
Row │ V1
│ Symbol
─────┼────────
1 │ True
2 │ False
As you can see the type is now a Symbol. If we define it just like True/False the type will be Sym like this:
julia> df = DataFrame(V1 = [True, False])
2×1 DataFrame
Row │ V1
│ Sym
─────┼───────
1 │ True
2 │ False
As you can see the type is now Sym. Here using typeof for both True:
julia> typeof(:True)
Symbol
julia> typeof(True)
Sym
I know we have this beautiful answer: What is a "symbol" in Julia?, but I can't find anything about Sym. So I was wondering what is the difference between Symbol and Sym in a dataframe of Julia?
Version of DataFrames:
julia> Pkg.status("DataFrames")
Status `~/.julia/environments/v1.8/Project.toml`
[a93c6f00] DataFrames v1.4.4