小编JPi*_*JPi的帖子

如何在 Julia 中定义一个空的 DataFrame 数组?

我想生成一个空的数据帧数组,稍后将在代码中填充,但我还没有想出如何去做。任何帮助,将不胜感激!

我尝试了定义空数组的标准方法。

julia> df = Array{DataFrame}(undef,10)
10-element Array{DataFrame,1}:
 #undef
 #undef
 #undef
 #undef
 #undef
 #undef
 #undef
 #undef
 #undef
 #undef

julia> println(typeof(df[1]))
ERROR: UndefRefError: access to undefined reference
Stacktrace:
 [1] getindex(::Array{DataFrame,1}, ::Int64) at ./array.jl:729
 [2] top-level scope at none:0
Run Code Online (Sandbox Code Playgroud)

我希望 typeof(df[1]) 说 DataFrame,但它失败并显示错误消息。

arrays initialization defaultifempty dataframe julia

2
推荐指数
2
解决办法
486
查看次数