如何加入 Julia 中的列?

How to join columns in Julia?

我在 julia 中打开了一个数据框,其中有 3 列,如下所示:

day   month    year
1       1      2011
2       4      2015
3       12     2018

如何创建一个名为 date 的新列:

day   month    year    date
1       1      2011    1/1/2011
2       4      2015    2/4/2015
3       12     2018    3/12/2018

我正在尝试这样做:

df[!,:date]= df.day.*"/".*df.month.*"/".*df.year

但是没用。

在 R 中我会这样做:

df$date=paste(df$day, df$month, df$year, sep="/")

有类似的吗?

提前致谢!

Julia 在其标准库中有一个内置的 Date 类型:

julia> using Dates

julia> df[!, :date] = Date.(df.year, df.month, df.day)
3-element Vector{Date}:
 2011-01-01
 2015-04-02
 2018-12-03