coding-style - julia 中的 "setindex! not defined"错误是什么?

标签 coding-style julia ijulia-notebook

当我运行我的代码时,我的代码 setindex! 发生了一个错误!没有为 WeakRefStrings.StringArray{String,1} 定义

CSV 文件 here .

using CSV
EVDdata =CSV.read(raw"wikipediaEVDdatesconverted.csv")
EVDdata[end-9:end,:]

错误代码是here

rows, cols = size(EVDdata)
for j =1:cols
    for i = 1:rows
        if !isdigit(string(EVDdata[i, j])[1])
            EVDdata[i,j] = 0
        end
    end
end

我在 Jupter Notebook 上使用 Julia 1.4.1

最佳答案

setindex!(collection, item, inds...)colection[inds...] = item 被降低到的函数。错误来自于 CSV.read 生成不可变集合这一事实。

关于coding-style - julia 中的 "setindex! not defined"错误是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61995125/

相关文章:

for-loop - Julia 中异步多个计算的并行代码

performance - Julia 与 MATLAB : Why is my Julia code so slow?

使用 nbconvert 将 Julia DataFrames 格式转换为 pdf

haskell - 有没有一种很好的方法可以让 Haskell 中的函数签名提供更多信息?

php - Laravel:在哪里抛出 HTTP 异常

julia - 在 julia 中有效地求解特定的线性系统

julia - Julia 使用参数化类型创建空对象的方法是什么?

printf - 在 Julia 中重复格式字符串的正确方法是什么?

Java 编码约定 - 这些花括号有什么用?

c++ - 过度使用重新定义原始数据类型?