Home > other >  How to refer to non-standard column names in DataFrames.jl
How to refer to non-standard column names in DataFrames.jl

Time:01-22

I have a data table containing some columns that have spaces in their names. How I can reference these columns by name (e.g. Column 1) if I want to select just that column of the dataframe? I tried data.Column 1 but this isn't workin.

CodePudding user response:

The DataFrames manual mentions the many ways of indexing available. For eg.


julia> df."Column 1"
5-element Vector{Int64}:
 1
 2
 3
 4
 5

julia> df[!, "Column 1"]
5-element Vector{Int64}:
 1
 2
 3
 4
 5

  •  Tags:  
  • Related