julia1.4.2,读取csv文件返回的DataFrame,用 df[row,col]=val 修改任一数据时,在32位系统下正常运行,但是在64位win7、Ubuntu系统都同样报错。我试过用数组生成的DataFrame,没有这个问题,这是一个BUG吗?
1.csv文件是5行13列浮点数
# code
using DataFrames,CSV
df=CSV.read("1.csv")
println(df[1,3]) #读取正常
df[1,3]=1.0 #32位系统运行正常,64位系统报错
运行和报错信息:
julia> using DataFrames,CSV
julia> df=CSV.read(“1.csv”)
5××13 DataFrame. Omitted printing of 7 columns
││ Row ││ open ││ high ││ close ││ low ││ volume ││ price_change
││
││ ││ Float64 ││ Float64 ││ Float64 ││ Float64 ││ Float64 ││ Float64
││
├├──────────┼┼──────────────────┼┼──────────────────┼┼──────────────────┼┼──────
────────────┼┼──────────────────────┼┼────────────────────────────┤┤
││ 1 ││ 12.8 ││ 13.8 ││ 13.23 ││ 12.8 ││ 1806.1 ││ 0.43
││
││ 2 ││ 12.64 ││ 12.88 ││ 12.8 ││ 12.6 ││ 1.52322e6 ││ 0.2
││
││ 3 ││ 12.65 ││ 12.69 ││ 12.6 ││ 12.52 ││ 990807.0 ││ -0.04
││
││ 4 ││ 12.74 ││ 12.76 ││ 12.64 ││ 12.62 ││ 1.31908e6 ││ -0.16
││
││ 5 ││ 12.73 ││ 12.84 ││ 12.8 ││ 12.61 ││ 1.53952e6 ││ 0.04
││
julia> df[1,3]
13.23
julia> df[1,3]=1.0
ERROR: setindex! not defined for CSV.Column{Float64,Float64}
Stacktrace:
[1] error(::String, ::Type{T} where T) at .\error.jl:42
[2] error_if_canonical_setindex(::IndexLinear, ::CSV.Column{Float64,Float64}, :
:Int64) at .\abstractarray.jl:1081
[3] setindex!(::CSV.Column{Float64,Float64}, ::Float64, ::Int64) at .\abstracta
rray.jl:1072
[4] insert_single_entry!(::DataFrame, ::Float64, ::Int64, ::Int64) at C:\Users
Administrator.julia\packages\DataFrames\kwVTY\src\dataframe\dataframe.jl:523
[5] setindex!(::DataFrame, ::Float64, ::Int64, ::Int64) at C:\Users\Administrat
or.julia\packages\DataFrames\kwVTY\src\dataframe\dataframe.jl:557
[6] top-level scope at REPL[6]:1
julia>