Skip to content

what is the type of ds.A? #61

Open
@sprmnt21

Description

@sprmnt21
ds = Dataset(A = ["a", "b","a", "b"],B=[1,2,3,4])

julia> ds.A==ds[:,:A]
true

julia> typeof(ds.A)
DatasetColumn{Dataset, Vector{Union{Missing, String}}}

julia> typeof(ds[:,:A])
Vector{Union{Missing, String}} (alias for Array{Union{Missing, String}, 1})

julia> ds.A
4-element Vector{Union{Missing, String}}:
 "a"
 "b"
 "a"
 "b"

I had tried to make the concatenation between what I thought were two vectors [ds.A; ds.A]

ulia> [ds.A ; ds.A]
2-element Vector{DatasetColumn{Dataset, Vector{Union{Missing, String}}}}:
 DatasetColumn{Dataset, Vector{Union{Missing, String}}}(1, 4×3 Dataset
 Row │ A         B         C        
     │ identity  identity  identity
     │ String?   String?   String?
─────┼──────────────────────────────
   1 │ a         no        low
   2 │ b         yes       low
   3 │ a         no        hi
   4 │ b         no        hi, Union{Missing, String}["a", "b", "a", "b"])
 DatasetColumn{Dataset, Vector{Union{Missing, String}}}(1, 4×3 Dataset
 Row │ A         B         C        
     │ identity  identity  identity
     │ String?   String?   String?
─────┼──────────────────────────────
   1 │ a         no        low
   2 │ b         yes       low
   3 │ a         no        hi
   4 │ b         no        hi, Union{Missing, String}["a", "b", "a", "b"])


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions