Man*_*hos 3 xlsx dataframe julia
我在 excel 中有一些变量,我想将它们上传到 Julia 并估计一个线性模型。我的变量由实数组成,但是由 XLSX 创建的 DataFrame 中的每一列都是 Any 类型。
我想知道 XLSX 是否有办法为每列分配正确的类型。
谢谢
只是使用infer_eltypes=true这里是一个例子:
julia> DataFrame(XLSX.readtable("file.xlsx",1;infer_eltypes=true)...)
3×3 DataFrame
? Row ? col1 ? col2 ? col3 ?
? ? Int64 ? Float64 ? String ?
??????????????????????????????????
? 1 ? 1 ? 4.5 ? txt1 ?
? 2 ? 2 ? 5.5 ? txt2 ?
? 3 ? 3 ? 6.7 ? txt3 ?
Run Code Online (Sandbox Code Playgroud)